line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# -*- Mode: Perl -*- |
2
|
|
|
|
|
|
|
# Util.pm -- |
3
|
|
|
|
|
|
|
# Author : Ulrich Pfeifer |
4
|
|
|
|
|
|
|
# Created On : Thu Feb 1 16:08:41 1996 |
5
|
|
|
|
|
|
|
# Last Modified By: Ulrich Pfeifer |
6
|
|
|
|
|
|
|
# Last Modified On: Sun Apr 3 11:44:12 2005 |
7
|
|
|
|
|
|
|
# Language : Perl |
8
|
|
|
|
|
|
|
# Update Count : 8 |
9
|
|
|
|
|
|
|
# Status : Unknown, Use with caution! |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
package Text::German::Util; |
12
|
|
|
|
|
|
|
require Exporter; |
13
|
|
|
|
|
|
|
@ISA = qw(Exporter); |
14
|
|
|
|
|
|
|
@EXPORT = qw(bit_to_int wordclass $CAPITAL $LOWER $ADJEKTIV $UMLAUTR |
15
|
|
|
|
|
|
|
$VERB $FUNNY $ADJEKTIV $ANY); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub bit_to_int { |
18
|
2028
|
|
|
2028
|
0
|
2404
|
my $bitvec = shift; |
19
|
|
|
|
|
|
|
|
20
|
2028
|
|
|
|
|
10629
|
unpack('I', pack('b*', $bitvec)."\0\0\0\0"); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
$CAPITAL = bit_to_int('10000'); |
24
|
|
|
|
|
|
|
$LOWER = bit_to_int('01111'); |
25
|
|
|
|
|
|
|
$ADJEKTIV = bit_to_int('00100'); |
26
|
|
|
|
|
|
|
$VERB = bit_to_int('01000'); |
27
|
|
|
|
|
|
|
$FUNNY = bit_to_int('01001'); |
28
|
|
|
|
|
|
|
$ANY = bit_to_int('11111'); |
29
|
|
|
|
|
|
|
$UMLAUTR = "[äöü]"; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub wordclass { |
32
|
54
|
|
|
54
|
0
|
80
|
my ($word, $satz_anfang) = @_; |
33
|
|
|
|
|
|
|
|
34
|
54
|
100
|
|
|
|
169
|
if ($satz_anfang) { |
|
|
100
|
|
|
|
|
|
35
|
13
|
|
|
|
|
34
|
return $ANY; |
36
|
|
|
|
|
|
|
} elsif ($word =~ /^[A-ZÄÖÜ]/) { |
37
|
23
|
|
|
|
|
59
|
$CAPITAL; |
38
|
|
|
|
|
|
|
} else { |
39
|
18
|
|
|
|
|
55
|
$LOWER; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
} |