This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# perlbrew install perl-5.14.2 | |
Fetching perl-5.14.2 as /root/perl5/perlbrew/dists/perl-5.14.2.tar.gz | |
Installing /root/perl5/perlbrew/build/perl-5.14.2 into ~/perl5/perlbrew/perls/perl-5.14.2 | |
This could take a while. You can run the following command on another shell to track the status: | |
tail -f ~/perl5/perlbrew/build.log | |
Installed /root/perl5/perlbrew/build/perl-5.14.2 as perl-5.14.2 successfully. Run the following command to switch to it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
class LevenshteinDistance | |
def self.analyze(str1, str2, options = {}) | |
_options = {:insert_cost => 1, :delete_cost => 1, :replace_cost => 1}.merge(options) | |
# remove Line feed code | |
x = str1.chomp | |
y = str2.chomp | |
return 0 if x == y |