Thread Probleme mit RegEx und Worttypen
(49 answers)
Opened by Dingels at 2008-07-25 19:00
Funktioniert astrein, wenn der untersuchte Text tatsächlich die Keys sein sollen ...
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 my %hash = ('Abend' => 'NN', 'Sonne' => 'NN', 'Haus' => 'NN', 'Abendsonne' => 'who knows', ); for my $word ( keys %hash ) { for my $pre ( keys %hash ) { for my $post ( keys %hash ) { if ( "\L$word" eq "\L$pre$post" ) { print $word, $/; } } } } Abendsonne me and my writeups
|