Thread Probleme mit RegEx und Worttypen (49 answers)
Opened by Dingels at 2008-07-25 19:00

LanX-
 2008-07-25 21:08
#112754 #112754
User since
2008-07-15
1000 Artikel
BenutzerIn

user image
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

View full thread Probleme mit RegEx und Worttypen