line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- Mode: Perl -*- |
2
|
|
|
|
|
|
|
# Verb.pm -- |
3
|
|
|
|
|
|
|
# Author : Ulrich Pfeifer |
4
|
|
|
|
|
|
|
# Created On : Thu Feb 1 09:10:48 1996 |
5
|
|
|
|
|
|
|
# Last Modified By: Ulrich Pfeifer |
6
|
|
|
|
|
|
|
# Last Modified On: Sun Apr 3 11:44:28 2005 |
7
|
|
|
|
|
|
|
# Language : Perl |
8
|
|
|
|
|
|
|
# Update Count : 29 |
9
|
|
|
|
|
|
|
# Status : Unknown, Use with caution! |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
package Text::German::Verb; |
12
|
|
|
|
|
|
|
require Exporter; |
13
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
14
|
|
|
|
|
|
|
@EXPORT = qw(%VERB); |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
{ |
17
|
|
|
|
|
|
|
local ($_); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
while () { |
20
|
|
|
|
|
|
|
chomp; |
21
|
|
|
|
|
|
|
($verb, $key) = split; |
22
|
|
|
|
|
|
|
$VERB{$verb} = [split ':', $key]; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
close DATA; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub reduce { |
28
|
19
|
|
|
19
|
0
|
32
|
my($v,$s,$e) = @_; |
29
|
19
|
100
|
|
|
|
52
|
my $ge = ($v.$s =~ /^ge/)?'ge':''; |
30
|
|
|
|
|
|
|
|
31
|
19
|
|
|
|
|
22
|
while (1) { # algorithmus unklar |
32
|
|
|
|
|
|
|
#print "reduce: $s\n"; |
33
|
43
|
100
|
|
|
|
115
|
if (defined $VERB{$s}) { |
34
|
2
|
50
|
|
|
|
22
|
if ($VERB{$s}->[1]) { # 'ge' gehoert zum stamm |
35
|
0
|
|
|
|
|
0
|
my $vg = $v; |
36
|
0
|
|
|
|
|
0
|
$vg =~ s/^ge//; |
37
|
0
|
|
|
|
|
0
|
return ($vg, $ge.$VERB{$s}->[0], $e); |
38
|
|
|
|
|
|
|
} else { |
39
|
2
|
|
|
|
|
14
|
return ($v, $VERB{$s}->[0], $e); |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |
42
|
41
|
100
|
|
|
|
80
|
last unless $e; |
43
|
24
|
|
|
|
|
33
|
$s .= substr($e,0,1); |
44
|
24
|
|
|
|
|
34
|
$e = substr($e,1); |
45
|
|
|
|
|
|
|
} |
46
|
17
|
|
|
|
|
49
|
return undef; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
1; |
50
|
|
|
|
|
|
|
# stamm ersatz:ge gehoert zum wort |
51
|
|
|
|
|
|
|
# führ fahr:0 |
52
|
|
|
|
|
|
|
__DATA__ |