Text completion: Difference between revisions
m
→{{header|Perl}}: works with recent Perl
(Text completion en FreeBASIC) |
SqrtNegInf (talk | contribs) m (→{{header|Perl}}: works with recent Perl) |
||
Line 699:
use feature 'say';
use Path::Tiny;
use List::Util
# sub bi_gram { (lc shift) =~ /(?<=\K.)./g } ## doesn't work in recent versions of Perl
sub bi_gram {
my $line = lc shift;
uniq map { substr $line,$_,2 } 0 .. length($line)-2;
}
sub score {
|