Le site arthur.bebou.netlib.re - retour accueil
git clone git://bebou.netlib.re/arthur.bebou
Log | Files | Refs |
rasm.pl (358B)
1 use v5.36; 2 use Regexp::Assemble; 3 my $rasm = Regexp::Assemble->new; 4 5 undef $/; 6 sub slurp { local @ARGV = shift; <> } 7 8 my %corres; 9 for my ($v, $k) (split "\n", slurp 'corres') { 10 $corres{$k} = $v; 11 $rasm->add( $k); 12 } 13 14 my ($match) = map 15 qr!(https://sws.geonames.org/($_)/about.rdf)! 16 , $rasm->re; 17 18 $_ = slurp 'A'; 19 s{$match}{ $corres{$2} // $+{$1} }gex; 20 print;