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

LanX-
 2008-07-27 17:40
#112821 #112821
User since
2008-07-15
1000 Artikel
BenutzerIn

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

View full thread Probleme mit RegEx und Worttypen