Skip to content

Instantly share code, notes, and snippets.

@jimregan
Last active May 4, 2017 22:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimregan/f5b9752477c59dbec0d91cd55d854a65 to your computer and use it in GitHub Desktop.
Save jimregan/f5b9752477c59dbec0d91cd55d854a65 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use warnings;
use strict;
use utf8;
binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");
sub unfada {
my $w = shift;
$w =~ s/á/a/g;
$w =~ s/é/e/g;
$w =~ s/í/i/g;
$w =~ s/ó/o/g;
$w =~ s/ú/u/g;
$w =~ s/Á/A/g;
$w =~ s/É/E/g;
$w =~ s/Í/I/g;
$w =~ s/Ó/O/g;
$w =~ s/Ú/U/g;
$w;
}
while(<>) {
chomp;
my ($l, $r) = split/=/;
if(unfada($l) eq unfada($r)) {
print "$_\n";
}
}
#!/usr/bin/perl
use warnings;
use strict;
use utf8;
binmode(STDIN, ":utf8");
binmode(STDOUT, ":utf8");
binmode(STDERR, ":utf8");
while(<>) {
chomp;
next if($_ !~ /-/);
my ($l, $r) = split/=/;
my $lorig = $l;
$l =~ s/-/ /g;
if($l eq $r) {
print "$lorig+\n";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment