lingo 1.8.5 → 1.8.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ChangeLog +25 -0
- data/README +7 -5
- data/Rakefile +58 -55
- data/{lingo-call.cfg → config/lingo-call.cfg} +1 -1
- data/{lingo.cfg → config/lingo.cfg} +10 -2
- data/{lir.cfg → config/lir.cfg} +10 -2
- data/{de → dict/de}/lingo-abk.txt +0 -0
- data/{de → dict/de}/lingo-dic.txt +0 -0
- data/{de → dict/de}/lingo-mul.txt +0 -0
- data/{de → dict/de}/lingo-syn.txt +0 -0
- data/{de → dict/de}/test_dic.txt +0 -0
- data/{de → dict/de}/test_gen.txt +0 -0
- data/{de → dict/de}/test_mu2.txt +0 -0
- data/{de → dict/de}/test_mul.txt +0 -0
- data/{de → dict/de}/test_sgw.txt +0 -0
- data/{de → dict/de}/test_syn.txt +0 -0
- data/{de → dict/de}/user-dic.txt +0 -0
- data/{en → dict/en}/lingo-dic.txt +0 -0
- data/{en → dict/en}/lingo-irr.txt +0 -0
- data/{en → dict/en}/lingo-mul.txt +0 -0
- data/{en → dict/en}/lingo-syn.txt +0 -0
- data/{en → dict/en}/lingo-wdn.txt +0 -0
- data/{en → dict/en}/user-dic.txt +0 -0
- data/{ru → dict/ru}/lingo-dic.txt +0 -0
- data/{ru → dict/ru}/lingo-mul.txt +0 -0
- data/{ru → dict/ru}/lingo-syn.txt +0 -0
- data/{ru → dict/ru}/user-dic.txt +0 -0
- data/{de.lang → lang/de.lang} +1 -1
- data/{en.lang → lang/en.lang} +0 -0
- data/{ru.lang → lang/ru.lang} +0 -0
- data/lib/lingo.rb +14 -15
- data/lib/lingo/app.rb +4 -2
- data/lib/lingo/attendee.rb +23 -43
- data/lib/lingo/attendee/abbreviator.rb +5 -5
- data/lib/lingo/attendee/debugger.rb +39 -12
- data/lib/lingo/attendee/decomposer.rb +3 -4
- data/lib/lingo/attendee/dehyphenizer.rb +4 -4
- data/lib/lingo/attendee/formatter.rb +1 -3
- data/lib/lingo/attendee/multi_worder.rb +3 -4
- data/lib/lingo/attendee/noneword_filter.rb +8 -12
- data/lib/lingo/attendee/object_filter.rb +6 -3
- data/lib/lingo/attendee/sequencer.rb +5 -5
- data/lib/lingo/attendee/stemmer.rb +3 -2
- data/lib/lingo/attendee/synonymer.rb +3 -4
- data/lib/lingo/attendee/text_reader.rb +39 -38
- data/lib/lingo/attendee/text_writer.rb +10 -10
- data/lib/lingo/attendee/tokenizer.rb +63 -33
- data/lib/lingo/attendee/variator.rb +3 -7
- data/lib/lingo/attendee/vector_filter.rb +132 -65
- data/lib/lingo/attendee/word_searcher.rb +5 -3
- data/lib/lingo/buffered_attendee.rb +1 -3
- data/lib/lingo/call.rb +4 -3
- data/lib/lingo/cli.rb +5 -1
- data/lib/lingo/config.rb +11 -5
- data/lib/lingo/ctl.rb +3 -3
- data/lib/lingo/database.rb +3 -1
- data/lib/lingo/database/crypter.rb +1 -3
- data/lib/lingo/database/source.rb +3 -1
- data/lib/lingo/database/source/key_value.rb +3 -1
- data/lib/lingo/database/source/multi_key.rb +3 -1
- data/lib/lingo/database/source/multi_value.rb +3 -1
- data/lib/lingo/database/source/single_word.rb +3 -1
- data/lib/lingo/database/source/word_class.rb +3 -1
- data/lib/lingo/debug.rb +5 -5
- data/lib/lingo/{agenda_item.rb → deferred_attendee.rb} +21 -12
- data/lib/lingo/error.rb +1 -1
- data/lib/lingo/language.rb +1 -9
- data/lib/lingo/language/dictionary.rb +2 -17
- data/lib/lingo/language/grammar.rb +10 -10
- data/lib/lingo/language/lexical.rb +2 -0
- data/lib/lingo/language/lexical_hash.rb +2 -0
- data/lib/lingo/language/token.rb +17 -3
- data/lib/lingo/language/word.rb +13 -5
- data/lib/lingo/language/word_form.rb +5 -3
- data/lib/lingo/progress.rb +2 -2
- data/lib/lingo/srv.rb +1 -1
- data/lib/lingo/srv/lingosrv.cfg +1 -1
- data/lib/lingo/version.rb +1 -1
- data/lib/lingo/web.rb +1 -1
- data/lib/lingo/web/lingoweb.cfg +1 -1
- data/test/attendee/ts_abbreviator.rb +4 -2
- data/test/attendee/ts_multi_worder.rb +81 -88
- data/test/attendee/ts_noneword_filter.rb +2 -2
- data/test/attendee/ts_object_filter.rb +2 -2
- data/test/attendee/ts_sequencer.rb +40 -20
- data/test/attendee/ts_stemmer.rb +52 -26
- data/test/attendee/ts_text_reader.rb +75 -56
- data/test/attendee/ts_text_writer.rb +6 -4
- data/test/attendee/ts_tokenizer.rb +304 -193
- data/test/attendee/ts_vector_filter.rb +242 -9
- data/test/ref/artikel.non +3 -0
- data/test/ref/artikel.vec +1 -4
- data/test/ref/artikel.vef +940 -0
- data/test/ref/artikel.ven +0 -3
- data/test/ref/artikel.ver +0 -3
- data/test/ref/artikel.vet +2580 -0
- data/test/ref/lir.non +34 -31
- data/test/ref/lir.seq +14 -15
- data/test/ref/lir.vec +37 -37
- data/test/ref/lir.vef +329 -0
- data/test/ref/lir.ven +329 -0
- data/test/ref/lir.ver +329 -0
- data/test/ref/lir.vet +329 -0
- data/test/test_helper.rb +29 -16
- data/test/ts_language.rb +6 -47
- metadata +74 -87
- data/lingo.rb +0 -29
- data/spec/spec_helper.rb +0 -5
data/lib/lingo/language/token.rb
CHANGED
@@ -28,28 +28,42 @@ class Lingo
|
|
28
28
|
|
29
29
|
module Language
|
30
30
|
|
31
|
+
#--
|
31
32
|
# Die Klasse Token, abgeleitet von der Klasse WordForm, stellt den Container
|
32
33
|
# für ein einzelnes Wort eines Textes dar. Das Wort wird mit einem Attribut versehen,
|
33
34
|
# welches der Regel entspricht, die dieses Wort identifiziert hat.
|
34
35
|
#
|
35
36
|
# Steht z.B. in ruby.cfg eine Regel zur Erkennung einer Zahl, die mit NUM bezeichnet wird,
|
36
37
|
# so wird dies dem Token angeheftet, z.B. Token.new('100', 'NUM') -> #100/NUM#
|
38
|
+
#++
|
37
39
|
|
38
40
|
class Token < WordForm
|
39
41
|
|
42
|
+
POSITION_SEP = ':'
|
43
|
+
|
40
44
|
def self.clean(attr)
|
41
45
|
attr.sub(/:.*/, '')
|
42
46
|
end
|
43
47
|
|
44
|
-
def initialize(
|
45
|
-
|
46
|
-
|
48
|
+
def initialize(form, attr, position = nil, offset = nil)
|
49
|
+
@position, @offset = position, offset
|
50
|
+
super(form, self.class.clean(attr))
|
47
51
|
end
|
48
52
|
|
53
|
+
attr_reader :position, :offset
|
54
|
+
|
49
55
|
def word?
|
50
56
|
attr == TA_WORD
|
51
57
|
end
|
52
58
|
|
59
|
+
def position_and_offset
|
60
|
+
"#{position}#{POSITION_SEP}#{offset}"
|
61
|
+
end
|
62
|
+
|
63
|
+
def to_a
|
64
|
+
[form, attr, position, offset]
|
65
|
+
end
|
66
|
+
|
53
67
|
def to_s
|
54
68
|
":#{super}:"
|
55
69
|
end
|
data/lib/lingo/language/word.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# Lingo -- A full-featured automatic indexing system #
|
7
7
|
# #
|
8
8
|
# Copyright (C) 2005-2007 John Vorhauer #
|
9
|
-
# Copyright (C) 2007-
|
9
|
+
# Copyright (C) 2007-2014 John Vorhauer, Jens Wille #
|
10
10
|
# #
|
11
11
|
# Lingo is free software; you can redistribute it and/or modify it under the #
|
12
12
|
# terms of the GNU Affero General Public License as published by the Free #
|
@@ -28,8 +28,10 @@ class Lingo
|
|
28
28
|
|
29
29
|
module Language
|
30
30
|
|
31
|
+
#--
|
31
32
|
# Die Klasse Word bündelt spezifische Eigenschaften eines Wortes mit den
|
32
33
|
# dazu notwendigen Methoden.
|
34
|
+
#++
|
33
35
|
|
34
36
|
class Word < WordForm
|
35
37
|
|
@@ -59,6 +61,7 @@ class Lingo
|
|
59
61
|
|
60
62
|
end
|
61
63
|
|
64
|
+
#--
|
62
65
|
# Exakte Representation der originären Zeichenkette, so wie sie im Satz
|
63
66
|
# gefunden wurde, z.B. <tt>form = "RubyLing"</tt>
|
64
67
|
#
|
@@ -71,12 +74,15 @@ class Lingo
|
|
71
74
|
#
|
72
75
|
# <b>Achtung: Lemma wird nicht durch die Word-Klasse bestückt, sondern extern
|
73
76
|
# durch die Klasse Dictionary</b>
|
77
|
+
#++
|
74
78
|
|
75
|
-
def initialize(form, attr = WA_UNSET)
|
79
|
+
def initialize(form, attr = WA_UNSET, token = nil)
|
80
|
+
@token, @lexicals = token, []
|
76
81
|
super
|
77
|
-
@lexicals = []
|
78
82
|
end
|
79
83
|
|
84
|
+
attr_reader :token
|
85
|
+
|
80
86
|
attr_writer :lexicals
|
81
87
|
|
82
88
|
def lexicals(compound_parts = true)
|
@@ -113,8 +119,6 @@ class Lingo
|
|
113
119
|
self
|
114
120
|
end
|
115
121
|
|
116
|
-
# Gibt genau die Grundform der Wortklasse zurück, die der RegExp des Übergabe-Parameters
|
117
|
-
# entspricht, z.B. <tt>word.get_wc(/a/) = ['abgeschoben', '#a']</tt>
|
118
122
|
def get_class(wc_re)
|
119
123
|
wc_re = Regexp.new(wc_re) unless wc_re.is_a?(Regexp)
|
120
124
|
|
@@ -138,6 +142,10 @@ class Lingo
|
|
138
142
|
lex = get_class(wc_re).first and lex.form.count(' ') + 1
|
139
143
|
end
|
140
144
|
|
145
|
+
def position_and_offset
|
146
|
+
token.position_and_offset if token
|
147
|
+
end
|
148
|
+
|
141
149
|
def <<(*lex)
|
142
150
|
lex.flatten!
|
143
151
|
@lexicals.concat(lex)
|
@@ -6,7 +6,7 @@
|
|
6
6
|
# Lingo -- A full-featured automatic indexing system #
|
7
7
|
# #
|
8
8
|
# Copyright (C) 2005-2007 John Vorhauer #
|
9
|
-
# Copyright (C) 2007-
|
9
|
+
# Copyright (C) 2007-2014 John Vorhauer, Jens Wille #
|
10
10
|
# #
|
11
11
|
# Lingo is free software; you can redistribute it and/or modify it under the #
|
12
12
|
# terms of the GNU Affero General Public License as published by the Free #
|
@@ -28,9 +28,11 @@ class Lingo
|
|
28
28
|
|
29
29
|
module Language
|
30
30
|
|
31
|
+
#--
|
31
32
|
# Die Klasse WordForm ist die Basisklasse für weitere Klassen, die im Rahmen der
|
32
33
|
# Objektstruktur eines Wortes benötigt werden. Die Klasse stellt eine Zeichenkette bereit,
|
33
34
|
# die mit einem Attribut versehen werden kann.
|
35
|
+
#++
|
34
36
|
|
35
37
|
class WordForm
|
36
38
|
|
@@ -56,11 +58,11 @@ class Lingo
|
|
56
58
|
end
|
57
59
|
|
58
60
|
def to_a
|
59
|
-
[form, attr, gender]
|
61
|
+
[form, attr, gender]
|
60
62
|
end
|
61
63
|
|
62
64
|
def to_s
|
63
|
-
to_a.join('/')
|
65
|
+
to_a.compact.join('/')
|
64
66
|
end
|
65
67
|
|
66
68
|
def inspect
|
data/lib/lingo/progress.rb
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
# Lingo -- A full-featured automatic indexing system #
|
7
7
|
# #
|
8
8
|
# Copyright (C) 2005-2007 John Vorhauer #
|
9
|
-
# Copyright (C) 2007-
|
9
|
+
# Copyright (C) 2007-2014 John Vorhauer, Jens Wille #
|
10
10
|
# #
|
11
11
|
# Lingo is free software; you can redistribute it and/or modify it under the #
|
12
12
|
# terms of the GNU Affero General Public License as published by the Free #
|
@@ -54,7 +54,7 @@ class Lingo
|
|
54
54
|
begin
|
55
55
|
yield self
|
56
56
|
ensure
|
57
|
-
trap(:INT,
|
57
|
+
trap(:INT, int)
|
58
58
|
end
|
59
59
|
|
60
60
|
suc = true
|
data/lib/lingo/srv.rb
CHANGED
data/lib/lingo/srv/lingosrv.cfg
CHANGED
data/lib/lingo/version.rb
CHANGED
data/lib/lingo/web.rb
CHANGED
@@ -48,7 +48,7 @@ class Lingo
|
|
48
48
|
use(Rack::Auth::Basic) { |*b| b == c } unless c.empty?
|
49
49
|
end
|
50
50
|
|
51
|
-
LINGO = Hash.
|
51
|
+
LINGO = Hash.nest { |k| Lingo.call(cfg, ['-l', k]) }
|
52
52
|
|
53
53
|
CFG, s, h = '', StringScanner.new(''), ERB::Util.method(:h)
|
54
54
|
c = lambda { |n| %Q{<span style="color:#{n}">#{h[s.matched]}</span>} }
|
data/lib/lingo/web/lingoweb.cfg
CHANGED
@@ -33,7 +33,8 @@ class TestAttendeeAbbreviator < AttendeeTestCase
|
|
33
33
|
tk('Punkt|WORD'),
|
34
34
|
tk('am|WORD'),
|
35
35
|
tk('Ende|WORD'),
|
36
|
-
ai('EOF|')
|
36
|
+
ai('EOF|'),
|
37
|
+
ai('EOT|')
|
37
38
|
], [
|
38
39
|
tk('Dieser|WORD'),
|
39
40
|
tk('Satz|WORD'),
|
@@ -42,7 +43,8 @@ class TestAttendeeAbbreviator < AttendeeTestCase
|
|
42
43
|
tk('Punkt|WORD'),
|
43
44
|
tk('am|WORD'),
|
44
45
|
tk('Ende|WORD'),
|
45
|
-
ai('EOF|')
|
46
|
+
ai('EOF|'),
|
47
|
+
ai('EOT|')
|
46
48
|
])
|
47
49
|
end
|
48
50
|
|
@@ -7,53 +7,41 @@ class TestAttendeeMultiWorder < AttendeeTestCase
|
|
7
7
|
def test_basic
|
8
8
|
meet({ 'source' => 'tst-mul' }, [
|
9
9
|
ai('FILE|mul.txt'),
|
10
|
-
# John_F_._Kennedy
|
11
10
|
wd('John|IDF', 'john|e'), wd('F|?'), tk('.|PUNC'), wd('Kennedy|IDF', 'kennedy|e'),
|
12
|
-
# John_F_Kennedy
|
13
11
|
wd('John|IDF', 'john|e'), wd('F|?'), wd('Kennedy|IDF', 'kennedy|e'),
|
14
|
-
# John_F_Kennedy_.
|
15
12
|
wd('John|IDF', 'john|e'), wd('F|?'), wd('Kennedy|IDF', 'kennedy|e'), tk('.|PUNC'),
|
16
|
-
# a_priori
|
17
13
|
wd('a|?'), wd('priori|IDF', 'priori|w'),
|
18
|
-
# Ableitung_nicht_ganzzahliger_Ordnung
|
19
14
|
wd('Ableitung|IDF', 'ableitung|s'),
|
20
15
|
wd('nicht|IDF', 'nicht|w'),
|
21
16
|
wd('ganzzahliger|IDF', 'ganzzahlig|a'),
|
22
17
|
wd('Ordnung|IDF', 'ordnung|s'),
|
23
|
-
# Academic_learning_time_in_physical_education
|
24
18
|
wd('academic|?'), wd('learning|?'), wd('time|IDF', 'timen|v'),
|
25
19
|
wd('in|IDF', 'in|t'), wd('physical|?'), wd('education|?'),
|
26
|
-
# Satzende
|
27
20
|
tk('.|PUNC'),
|
28
|
-
ai('EOF|mul.txt')
|
21
|
+
ai('EOF|mul.txt'),
|
22
|
+
ai('EOT|')
|
29
23
|
], [
|
30
24
|
ai('FILE|mul.txt'),
|
31
|
-
# John_F_._Kennedy
|
32
25
|
wd('John F. Kennedy|MUL', 'john f. kennedy|m'),
|
33
26
|
wd('John|IDF', 'john|e'), wd('F|MU?'), wd('Kennedy|IDF', 'kennedy|e'),
|
34
|
-
# John_F_Kennedy
|
35
27
|
wd('John F Kennedy|MUL', 'john f. kennedy|m'),
|
36
28
|
wd('John|IDF', 'john|e'), wd('F|MU?'), wd('Kennedy|IDF', 'kennedy|e'),
|
37
|
-
# John_F_Kennedy_.
|
38
29
|
wd('John F Kennedy|MUL', 'john f. kennedy|m'),
|
39
30
|
wd('John|IDF', 'john|e'), wd('F|MU?'), wd('Kennedy|IDF', 'kennedy|e'),
|
40
31
|
tk('.|PUNC'),
|
41
|
-
# a_priori
|
42
32
|
wd('a priori|MUL', 'a priori|m'),
|
43
33
|
wd('a|MU?'), wd('priori|IDF', 'priori|w'),
|
44
|
-
# Ableitung_nicht_ganzzahliger_Ordnung
|
45
34
|
wd('Ableitung nicht ganzzahliger Ordnung|MUL', 'ableitung nicht ganzzahliger ordnung|m'),
|
46
35
|
wd('Ableitung|IDF', 'ableitung|s'),
|
47
36
|
wd('nicht|IDF', 'nicht|w'),
|
48
37
|
wd('ganzzahliger|IDF', 'ganzzahlig|a'),
|
49
38
|
wd('Ordnung|IDF', 'ordnung|s'),
|
50
|
-
# Academic_learning_time_in_physical_education
|
51
39
|
wd('academic learning time in physical education|MUL', 'academic learning time in physical education|m'),
|
52
40
|
wd('academic|MU?'), wd('learning|MU?'), wd('time|IDF', 'timen|v'),
|
53
41
|
wd('in|IDF', 'in|t'), wd('physical|MU?'), wd('education|MU?'),
|
54
|
-
# Satzende
|
55
42
|
tk('.|PUNC'),
|
56
|
-
ai('EOF|mul.txt')
|
43
|
+
ai('EOF|mul.txt'),
|
44
|
+
ai('EOT|')
|
57
45
|
])
|
58
46
|
end
|
59
47
|
|
@@ -61,45 +49,53 @@ class TestAttendeeMultiWorder < AttendeeTestCase
|
|
61
49
|
meet({ 'source' => 'tst-mul' }, [
|
62
50
|
ai('FILE|mul.txt'),
|
63
51
|
wd('Abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), tk('.|PUNC'),
|
64
|
-
ai('EOF|mul.txt')
|
52
|
+
ai('EOF|mul.txt'),
|
53
|
+
ai('EOT|')
|
65
54
|
], [
|
66
55
|
ai('FILE|mul.txt'),
|
67
56
|
wd('Abelsches Schema|MUL', 'abelsches schema|m'),
|
68
57
|
wd('Abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), tk('.|PUNC'),
|
69
|
-
ai('EOF|mul.txt')
|
58
|
+
ai('EOF|mul.txt'),
|
59
|
+
ai('EOT|')
|
70
60
|
])
|
71
61
|
|
72
62
|
meet({ 'source' => 'tst-mul' }, [
|
73
63
|
ai('FILE|mul.txt'),
|
74
64
|
wd('Tolles|IDF', 'toll|a'), wd('abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), tk('.|PUNC'),
|
75
|
-
ai('EOF|mul.txt')
|
65
|
+
ai('EOF|mul.txt'),
|
66
|
+
ai('EOT|')
|
76
67
|
], [
|
77
68
|
ai('FILE|mul.txt'),
|
78
69
|
wd('Tolles abelsches Schema|MUL', 'tolles abelsches schema|m'),
|
79
70
|
wd('Tolles|IDF', 'toll|a'), wd('abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), tk('.|PUNC'),
|
80
|
-
ai('EOF|mul.txt')
|
71
|
+
ai('EOF|mul.txt'),
|
72
|
+
ai('EOT|')
|
81
73
|
])
|
82
74
|
|
83
75
|
meet({ 'source' => 'tst-mul' }, [
|
84
76
|
ai('FILE|mul.txt'),
|
85
77
|
wd('Super|IDF', 'super|a'), wd('tolles|IDF', 'toll|a'), wd('abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), tk('.|PUNC'),
|
86
|
-
ai('EOF|mul.txt')
|
78
|
+
ai('EOF|mul.txt'),
|
79
|
+
ai('EOT|')
|
87
80
|
], [
|
88
81
|
ai('FILE|mul.txt'),
|
89
82
|
wd('Super tolles abelsches Schema|MUL', 'super tolles abelsches schema|m'),
|
90
83
|
wd('Super|IDF', 'super|a'), wd('tolles|IDF', 'toll|a'), wd('abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), tk('.|PUNC'),
|
91
|
-
ai('EOF|mul.txt')
|
84
|
+
ai('EOF|mul.txt'),
|
85
|
+
ai('EOT|')
|
92
86
|
])
|
93
87
|
|
94
88
|
meet({ 'source' => 'tst-mul' }, [
|
95
89
|
ai('FILE|mul.txt'),
|
96
90
|
wd('Extra|IDF', 'extra|a'), wd('super|IDF', 'super|a'), wd('tolles|IDF', 'toll|a'), wd('abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), tk('.|PUNC'),
|
97
|
-
ai('EOF|mul.txt')
|
91
|
+
ai('EOF|mul.txt'),
|
92
|
+
ai('EOT|')
|
98
93
|
], [
|
99
94
|
ai('FILE|mul.txt'),
|
100
95
|
wd('Extra super tolles abelsches Schema|MUL', 'extra super tolles abelsches schema|m'),
|
101
96
|
wd('Extra|IDF', 'extra|a'), wd('super|IDF', 'super|a'), wd('tolles|IDF', 'toll|a'), wd('abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), tk('.|PUNC'),
|
102
|
-
ai('EOF|mul.txt')
|
97
|
+
ai('EOF|mul.txt'),
|
98
|
+
ai('EOT|')
|
103
99
|
])
|
104
100
|
end
|
105
101
|
|
@@ -107,45 +103,53 @@ class TestAttendeeMultiWorder < AttendeeTestCase
|
|
107
103
|
meet({ 'source' => 'tst-mul' }, [
|
108
104
|
ai('FILE|mul.txt'),
|
109
105
|
wd('Abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), tk('.|PUNC'),
|
110
|
-
ai('EOF|mul.txt')
|
106
|
+
ai('EOF|mul.txt'),
|
107
|
+
ai('EOT|')
|
111
108
|
], [
|
112
109
|
ai('FILE|mul.txt'),
|
113
110
|
wd('Abelsches Schema|MUL', 'abelsches schema|m'),
|
114
111
|
wd('Abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), tk('.|PUNC'),
|
115
|
-
ai('EOF|mul.txt')
|
112
|
+
ai('EOF|mul.txt'),
|
113
|
+
ai('EOT|')
|
116
114
|
])
|
117
115
|
|
118
116
|
meet({ 'source' => 'tst-mul' }, [
|
119
117
|
ai('FILE|mul.txt'),
|
120
118
|
wd('Abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), wd('toll|IDF', 'toll|a'), tk('.|PUNC'),
|
121
|
-
ai('EOF|mul.txt')
|
119
|
+
ai('EOF|mul.txt'),
|
120
|
+
ai('EOT|')
|
122
121
|
], [
|
123
122
|
ai('FILE|mul.txt'),
|
124
123
|
wd('Abelsches Schema toll|MUL', 'abelsches schema toll|m'),
|
125
124
|
wd('Abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), wd('toll|IDF', 'toll|a'), tk('.|PUNC'),
|
126
|
-
ai('EOF|mul.txt')
|
125
|
+
ai('EOF|mul.txt'),
|
126
|
+
ai('EOT|')
|
127
127
|
])
|
128
128
|
|
129
129
|
meet({ 'source' => 'tst-mul' }, [
|
130
130
|
ai('FILE|mul.txt'),
|
131
131
|
wd('Abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), wd('toll|IDF', 'toll|a'), wd('super|IDF', 'super|a'), tk('.|PUNC'),
|
132
|
-
ai('EOF|mul.txt')
|
132
|
+
ai('EOF|mul.txt'),
|
133
|
+
ai('EOT|')
|
133
134
|
], [
|
134
135
|
ai('FILE|mul.txt'),
|
135
136
|
wd('Abelsches Schema toll super|MUL', 'abelsches schema toll super|m'),
|
136
137
|
wd('Abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), wd('toll|IDF', 'toll|a'), wd('super|IDF', 'super|a'), tk('.|PUNC'),
|
137
|
-
ai('EOF|mul.txt')
|
138
|
+
ai('EOF|mul.txt'),
|
139
|
+
ai('EOT|')
|
138
140
|
])
|
139
141
|
|
140
142
|
meet({ 'source' => 'tst-mul' }, [
|
141
143
|
ai('FILE|mul.txt'),
|
142
144
|
wd('Abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), wd('toll|IDF', 'toll|a'), wd('super|IDF', 'super|a'), wd('extra|IDF', 'extra|a'), tk('.|PUNC'),
|
143
|
-
ai('EOF|mul.txt')
|
145
|
+
ai('EOF|mul.txt'),
|
146
|
+
ai('EOT|')
|
144
147
|
], [
|
145
148
|
ai('FILE|mul.txt'),
|
146
149
|
wd('Abelsches Schema toll super extra|MUL', 'abelsches schema toll super extra|m'),
|
147
150
|
wd('Abelsches|IDF', 'abelsch|a'), wd('Schema|IDF', 'schema|s'), wd('toll|IDF', 'toll|a'), wd('super|IDF', 'super|a'), wd('extra|IDF', 'extra|a'), tk('.|PUNC'),
|
148
|
-
ai('EOF|mul.txt')
|
151
|
+
ai('EOF|mul.txt'),
|
152
|
+
ai('EOT|')
|
149
153
|
])
|
150
154
|
end
|
151
155
|
|
@@ -154,172 +158,161 @@ class TestAttendeeMultiWorder < AttendeeTestCase
|
|
154
158
|
ai('FILE|mul.txt'),
|
155
159
|
wd('John|IDF', 'john|e'), wd('F|?'), tk('.|PUNC'), wd('Kennedy|IDF', 'kennedy|e'),
|
156
160
|
wd('war|IDF', 'war|w'), wd('einmal|IDF', 'einmal|w'), wd('Präsident|IDF', 'präsident|s'), tk('.|PUNC'),
|
157
|
-
ai('EOF|mul.txt')
|
161
|
+
ai('EOF|mul.txt'),
|
162
|
+
ai('EOT|')
|
158
163
|
], [
|
159
164
|
ai('FILE|mul.txt'),
|
160
165
|
wd('John F. Kennedy|MUL', 'john f. kennedy|m'),
|
161
166
|
wd('John|IDF', 'john|e'), wd('F|MU?'), wd('Kennedy|IDF', 'kennedy|e'),
|
162
167
|
wd('war|IDF', 'war|w'), wd('einmal|IDF', 'einmal|w'), wd('Präsident|IDF', 'präsident|s'), tk('.|PUNC'),
|
163
|
-
ai('EOF|mul.txt')
|
168
|
+
ai('EOF|mul.txt'),
|
169
|
+
ai('EOT|')
|
164
170
|
])
|
165
171
|
|
166
|
-
input.delete_at(-
|
172
|
+
input.delete_at(-4)
|
167
173
|
meet({ 'source' => 'tst-mul' }, input, [
|
168
174
|
ai('FILE|mul.txt'),
|
169
175
|
wd('John F. Kennedy|MUL', 'john f. kennedy|m'),
|
170
176
|
wd('John|IDF', 'john|e'), wd('F|MU?'), wd('Kennedy|IDF', 'kennedy|e'),
|
171
177
|
wd('war|IDF', 'war|w'), wd('einmal|IDF', 'einmal|w'), tk('.|PUNC'),
|
172
|
-
ai('EOF|mul.txt')
|
178
|
+
ai('EOF|mul.txt'),
|
179
|
+
ai('EOT|')
|
173
180
|
])
|
174
181
|
|
175
|
-
input.delete_at(-
|
182
|
+
input.delete_at(-4)
|
176
183
|
meet({ 'source' => 'tst-mul' }, input, [
|
177
184
|
ai('FILE|mul.txt'),
|
178
185
|
wd('John F. Kennedy|MUL', 'john f. kennedy|m'),
|
179
186
|
wd('John|IDF', 'john|e'), wd('F|MU?'), wd('Kennedy|IDF', 'kennedy|e'),
|
180
187
|
wd('war|IDF', 'war|w'), tk('.|PUNC'),
|
181
|
-
ai('EOF|mul.txt')
|
188
|
+
ai('EOF|mul.txt'),
|
189
|
+
ai('EOT|')
|
182
190
|
])
|
183
191
|
|
184
|
-
input.delete_at(-
|
192
|
+
input.delete_at(-4)
|
185
193
|
meet({ 'source' => 'tst-mul' }, input, [
|
186
194
|
ai('FILE|mul.txt'),
|
187
195
|
wd('John F. Kennedy|MUL', 'john f. kennedy|m'),
|
188
196
|
wd('John|IDF', 'john|e'), wd('F|MU?'), wd('Kennedy|IDF', 'kennedy|e'),
|
189
197
|
tk('.|PUNC'),
|
190
|
-
ai('EOF|mul.txt')
|
198
|
+
ai('EOF|mul.txt'),
|
199
|
+
ai('EOT|')
|
191
200
|
])
|
192
201
|
end
|
193
202
|
|
194
203
|
def test_two_sources_mode_first
|
195
|
-
# in keinen WB enthalten
|
196
204
|
meet({ 'source' => 'tst-mul,tst-mu2', 'mode' => 'first' }, [
|
197
|
-
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt')
|
205
|
+
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
198
206
|
], [
|
199
|
-
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt')
|
207
|
+
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
200
208
|
])
|
201
209
|
|
202
|
-
# im ersten WB enthalten
|
203
210
|
meet({ 'source' => 'tst-mul,tst-mu2', 'mode' => 'first' }, [
|
204
|
-
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt')
|
211
|
+
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt'), ai('EOT|')
|
205
212
|
], [
|
206
213
|
wd('abstrakten Kunst|MUL', 'abstrakte kunst|m'),
|
207
|
-
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt')
|
214
|
+
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt'), ai('EOT|')
|
208
215
|
])
|
209
216
|
|
210
|
-
# im zweiten WB enthalten
|
211
217
|
meet({ 'source' => 'tst-mul,tst-mu2', 'mode' => 'first' }, [
|
212
|
-
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt')
|
218
|
+
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt'), ai('EOT|')
|
213
219
|
], [
|
214
220
|
wd('traumatischer Angelegenheit|MUL', 'traumatische angelegenheit|m'),
|
215
|
-
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt')
|
221
|
+
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt'), ai('EOT|')
|
216
222
|
])
|
217
223
|
|
218
|
-
# in beiden WB enthalten
|
219
224
|
meet({ 'source' => 'tst-mul,tst-mu2', 'mode' => 'first' }, [
|
220
|
-
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt')
|
225
|
+
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
221
226
|
], [
|
222
227
|
wd('azyklischen Bewegungen|MUL', 'chaotisches movement|m'),
|
223
|
-
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt')
|
228
|
+
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
224
229
|
])
|
225
230
|
end
|
226
231
|
|
227
232
|
def test_two_sources_mode_first_flipped
|
228
|
-
# in keinen WB enthalten
|
229
233
|
meet({ 'source' => 'tst-mu2,tst-mul', 'mode' => 'first' }, [
|
230
|
-
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt')
|
234
|
+
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
231
235
|
], [
|
232
|
-
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt')
|
236
|
+
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
233
237
|
])
|
234
238
|
|
235
|
-
# im ersten WB enthalten
|
236
239
|
meet({ 'source' => 'tst-mu2,tst-mul', 'mode' => 'first' }, [
|
237
|
-
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt')
|
240
|
+
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt'), ai('EOT|')
|
238
241
|
], [
|
239
242
|
wd('abstrakten Kunst|MUL', 'abstrakte kunst|m'),
|
240
|
-
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt')
|
243
|
+
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt'), ai('EOT|')
|
241
244
|
])
|
242
245
|
|
243
|
-
# im zweiten WB enthalten
|
244
246
|
meet({ 'source' => 'tst-mu2,tst-mul', 'mode' => 'first' }, [
|
245
|
-
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt')
|
247
|
+
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt'), ai('EOT|')
|
246
248
|
], [
|
247
249
|
wd('traumatischer Angelegenheit|MUL', 'traumatische angelegenheit|m'),
|
248
|
-
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt')
|
250
|
+
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt'), ai('EOT|')
|
249
251
|
])
|
250
252
|
|
251
|
-
# in beiden WB enthalten
|
252
253
|
meet({ 'source' => 'tst-mu2,tst-mul', 'mode' => 'first' }, [
|
253
|
-
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt')
|
254
|
+
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
254
255
|
], [
|
255
256
|
wd('azyklischen Bewegungen|MUL', 'azyklische bewegung|m'),
|
256
|
-
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt')
|
257
|
+
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
257
258
|
])
|
258
259
|
end
|
259
260
|
|
260
261
|
def test_select_two_sources_mode_all
|
261
|
-
# in keinen WB enthalten
|
262
262
|
meet({ 'source' => 'tst-mu2,tst-mul', 'mode' => 'all' }, [
|
263
|
-
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt')
|
263
|
+
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
264
264
|
], [
|
265
|
-
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt')
|
265
|
+
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
266
266
|
])
|
267
267
|
|
268
|
-
# im ersten WB enthalten
|
269
268
|
meet({ 'source' => 'tst-mu2,tst-mul', 'mode' => 'all' }, [
|
270
|
-
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt')
|
269
|
+
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt'), ai('EOT|')
|
271
270
|
], [
|
272
271
|
wd('abstrakten Kunst|MUL', 'abstrakte kunst|m'),
|
273
|
-
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt')
|
272
|
+
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt'), ai('EOT|')
|
274
273
|
])
|
275
274
|
|
276
|
-
# im zweiten WB enthalten
|
277
275
|
meet({ 'source' => 'tst-mu2,tst-mul', 'mode' => 'all' }, [
|
278
|
-
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt')
|
276
|
+
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt'), ai('EOT|')
|
279
277
|
], [
|
280
278
|
wd('traumatischer Angelegenheit|MUL', 'traumatische angelegenheit|m'),
|
281
|
-
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt')
|
279
|
+
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt'), ai('EOT|')
|
282
280
|
])
|
283
281
|
|
284
|
-
# in beiden WB enthalten
|
285
282
|
meet({ 'source' => 'tst-mu2,tst-mul', 'mode' => 'all' }, [
|
286
|
-
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt')
|
283
|
+
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
287
284
|
], [
|
288
285
|
wd('azyklischen Bewegungen|MUL', 'azyklische bewegung|m', 'chaotisches movement|m'),
|
289
|
-
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt')
|
286
|
+
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
290
287
|
])
|
291
288
|
end
|
292
289
|
|
293
290
|
def test_select_two_sources_mode_def
|
294
|
-
# in keinen WB enthalten
|
295
291
|
meet({ 'source' => 'tst-mu2,tst-mul' }, [
|
296
|
-
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt')
|
292
|
+
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
297
293
|
], [
|
298
|
-
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt')
|
294
|
+
wd('intelligente|IDF', 'intelligent|a'), wd('Indexierung|IDF', 'indexierung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
299
295
|
])
|
300
296
|
|
301
|
-
# im ersten WB enthalten
|
302
297
|
meet({ 'source' => 'tst-mu2,tst-mul' }, [
|
303
|
-
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt')
|
298
|
+
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt'), ai('EOT|')
|
304
299
|
], [
|
305
300
|
wd('abstrakten Kunst|MUL', 'abstrakte kunst|m'),
|
306
|
-
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt')
|
301
|
+
wd('abstrakten|IDF', 'abstrakt|a'), wd('Kunst|IDF', 'kunst|s'), ai('EOF|mul.txt'), ai('EOT|')
|
307
302
|
])
|
308
303
|
|
309
|
-
# im zweiten WB enthalten
|
310
304
|
meet({ 'source' => 'tst-mu2,tst-mul' }, [
|
311
|
-
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt')
|
305
|
+
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt'), ai('EOT|')
|
312
306
|
], [
|
313
307
|
wd('traumatischer Angelegenheit|MUL', 'traumatische angelegenheit|m'),
|
314
|
-
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt')
|
308
|
+
wd('traumatischer|IDF', 'traumatisch|a'), wd('Angelegenheit|IDF', 'angelegenheit|s'), ai('EOF|mul.txt'), ai('EOT|')
|
315
309
|
])
|
316
310
|
|
317
|
-
# in beiden WB enthalten
|
318
311
|
meet({ 'source' => 'tst-mu2,tst-mul' }, [
|
319
|
-
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt')
|
312
|
+
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
320
313
|
], [
|
321
314
|
wd('azyklischen Bewegungen|MUL', 'azyklische bewegung|m', 'chaotisches movement|m'),
|
322
|
-
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt')
|
315
|
+
wd('azyklischen|IDF', 'azyklisch|a'), wd('Bewegungen|IDF', 'bewegung|s'), ai('EOF|mul.txt'), ai('EOT|')
|
323
316
|
])
|
324
317
|
end
|
325
318
|
|