Last active
January 29, 2016 09:42
-
-
Save nazarov-yuriy/fbfd694ca8dc8b2c8df4 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use Text::Aspell; | |
sub main() { | |
my $str = "Уважаемые пассажиры, во избежание травм держитесь за поручни"; | |
my $speller = Text::Aspell->new; | |
die unless $speller; | |
$speller->set_option('lang', 'ru_RU'); | |
for my $word (split /[, ]+/, $str) { | |
for my $i (grep{$_%2==0} (0..length($word)-1)) { | |
my $copy = $word; | |
substr($copy, $i, 2) = ""; | |
print "$copy\n" if $speller->check($copy); | |
} | |
} | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment