Thread Probleme mit RegEx und Worttypen
(49 answers)
Opened by Dingels at 2008-07-25 19:00
Quadratischer Aufwand:
Code (perl): (dl
)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 #!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %hash = ('Abend' => 'NN', 'Sonne' => 'NN', 'Haus' => 'NN', 'Abendsonne' => 'who knows', ); my %klein= map {(lc $_ => $_)} keys %hash; my @woerter=keys %klein; for my $pre ( @woerter ) { for my $post ( @woerter ) { my $kompo = $pre.$post; if ( $klein{$kompo} ) { print "$kompo \t $klein{$kompo} \t $hash{$klein{$kompo}} \n"; } } } abendsonne Abendsonne who knows me and my writeups
|