mittens 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +1 -0
- data/README.md +2 -2
- data/Rakefile +10 -3
- data/lib/mittens/version.rb +1 -1
- data/vendor/snowball/.github/workflows/ci.yml +144 -17
- data/vendor/snowball/.github/workflows/coverage.yml +117 -0
- data/vendor/snowball/.github/workflows/runtime-tests.yml +26 -0
- data/vendor/snowball/.gitignore +33 -7
- data/vendor/snowball/CONTRIBUTING.rst +7 -0
- data/vendor/snowball/COPYING +1 -1
- data/vendor/snowball/GNUmakefile +736 -298
- data/vendor/snowball/NEWS +1394 -7
- data/vendor/snowball/README.rst +8 -8
- data/vendor/snowball/ada/generate/generate.adb +5 -5
- data/vendor/snowball/ada/src/stemmer.adb +177 -188
- data/vendor/snowball/ada/src/stemmer.ads +86 -89
- data/vendor/snowball/ada/src/stemwords.adb +21 -5
- data/vendor/snowball/algorithms/czech.sbl +255 -0
- data/vendor/snowball/algorithms/danish.sbl +22 -10
- data/vendor/snowball/algorithms/english.sbl +7 -4
- data/vendor/snowball/algorithms/esperanto.sbl +6 -7
- data/vendor/snowball/algorithms/estonian.sbl +9 -4
- data/vendor/snowball/algorithms/finnish.sbl +33 -21
- data/vendor/snowball/algorithms/german.sbl +5 -0
- data/vendor/snowball/algorithms/indonesian.sbl +115 -96
- data/vendor/snowball/algorithms/italian.sbl +26 -1
- data/vendor/snowball/algorithms/lithuanian.sbl +13 -13
- data/vendor/snowball/algorithms/norwegian.sbl +17 -6
- data/vendor/snowball/algorithms/persian.sbl +387 -0
- data/vendor/snowball/algorithms/polish.sbl +177 -0
- data/vendor/snowball/algorithms/sesotho.sbl +115 -0
- data/vendor/snowball/algorithms/turkish.sbl +4 -4
- data/vendor/snowball/compiler/analyser.c +2002 -711
- data/vendor/snowball/compiler/driver.c +460 -298
- data/vendor/snowball/compiler/generator.c +439 -1965
- data/vendor/snowball/compiler/generator_ada.c +605 -430
- data/vendor/snowball/compiler/generator_c.c +2227 -0
- data/vendor/snowball/compiler/generator_csharp.c +365 -274
- data/vendor/snowball/compiler/generator_dart.c +1476 -0
- data/vendor/snowball/compiler/generator_go.c +348 -270
- data/vendor/snowball/compiler/generator_java.c +330 -233
- data/vendor/snowball/compiler/generator_js.c +534 -385
- data/vendor/snowball/compiler/generator_pascal.c +361 -320
- data/vendor/snowball/compiler/generator_php.c +1445 -0
- data/vendor/snowball/compiler/generator_python.c +399 -299
- data/vendor/snowball/compiler/generator_rust.c +370 -261
- data/vendor/snowball/compiler/generator_zig.c +1474 -0
- data/vendor/snowball/compiler/header.h +153 -86
- data/vendor/snowball/compiler/space.c +121 -63
- data/vendor/snowball/compiler/tokeniser.c +286 -182
- data/vendor/snowball/compiler/tokens.h +71 -0
- data/vendor/snowball/csharp/Snowball/Among.cs +14 -26
- data/vendor/snowball/csharp/Snowball/AssemblyInfo.cs +3 -3
- data/vendor/snowball/csharp/Snowball/Stemmer.cs +41 -45
- data/vendor/snowball/csharp/Stemwords/Program.cs +20 -14
- data/vendor/snowball/cxx/.gitignore +4 -0
- data/vendor/snowball/cxx/generate_algorithms.pl +87 -0
- data/vendor/snowball/cxx/stemmer.h +12 -0
- data/vendor/snowball/cxx/stemwords.cxx +176 -0
- data/vendor/snowball/cxx/utilities.cxx +2 -0
- data/vendor/snowball/dart/.gitignore +4 -0
- data/vendor/snowball/dart/analysis_options.yaml +1 -0
- data/vendor/snowball/dart/example/test_app.dart +65 -0
- data/vendor/snowball/dart/generate_algorithms.pl +21 -0
- data/vendor/snowball/dart/lib/snowball.dart +18 -0
- data/vendor/snowball/dart/lib/src/snowball.dart +339 -0
- data/vendor/snowball/dart/pubspec.yaml +17 -0
- data/vendor/snowball/doc/libstemmer_dart_README +37 -0
- data/vendor/snowball/doc/libstemmer_js_README +2 -2
- data/vendor/snowball/doc/libstemmer_php_README +38 -0
- data/vendor/snowball/doc/libstemmer_python_README +3 -3
- data/vendor/snowball/examples/stemwords.c +18 -3
- data/vendor/snowball/go/README.md +12 -4
- data/vendor/snowball/go/env.go +12 -14
- data/vendor/snowball/go/stemwords/main.go +2 -1
- data/vendor/snowball/java/org/tartarus/snowball/CharArraySequence.java +36 -0
- data/vendor/snowball/java/org/tartarus/snowball/SnowballProgram.java +17 -34
- data/vendor/snowball/java/org/tartarus/snowball/SnowballStemmer.java +0 -2
- data/vendor/snowball/javascript/base-stemmer.js +219 -252
- data/vendor/snowball/javascript/stemwords.js +86 -58
- data/vendor/snowball/libstemmer/mkmodules.pl +1 -1
- data/vendor/snowball/libstemmer/modules.txt +4 -0
- data/vendor/snowball/pascal/SnowballProgram.pas +18 -31
- data/vendor/snowball/php/base-stemmer.php +453 -0
- data/vendor/snowball/php/stemwords.php +25 -0
- data/vendor/snowball/python/create_init.py +16 -21
- data/vendor/snowball/python/pyproject.toml +3 -0
- data/vendor/snowball/python/setup.py +5 -7
- data/vendor/snowball/python/snowballstemmer/among.py +1 -2
- data/vendor/snowball/python/snowballstemmer/basestemmer.py +24 -33
- data/vendor/snowball/python/stemwords.py +72 -63
- data/vendor/snowball/runtime/api.c +11 -42
- data/vendor/snowball/runtime/api.h +11 -9
- data/vendor/snowball/runtime/snowball_runtime.h +110 -0
- data/vendor/snowball/runtime/utilities.c +282 -106
- data/vendor/snowball/rust/src/main.rs +2 -2
- data/vendor/snowball/rust/src/snowball/snowball_env.rs +7 -9
- data/vendor/snowball/tests/compilertest +62 -0
- data/vendor/snowball/tests/errors/ae-errors.sbl +53 -0
- data/vendor/snowball/tests/errors/ae-errors.stderr +8 -0
- data/vendor/snowball/tests/errors/bad-dollar.sbl +14 -0
- data/vendor/snowball/tests/errors/bad-dollar.stderr +4 -0
- data/vendor/snowball/tests/errors/bad-grouping-definition.sbl +9 -0
- data/vendor/snowball/tests/errors/bad-grouping-definition.stderr +6 -0
- data/vendor/snowball/tests/errors/missing-bra.sbl +6 -0
- data/vendor/snowball/tests/errors/missing-bra.stderr +3 -0
- data/vendor/snowball/tests/errors/missing-command.sbl +9 -0
- data/vendor/snowball/tests/errors/missing-command.stderr +1 -0
- data/vendor/snowball/tests/errors/missing-ket-backwardmode.sbl +3 -0
- data/vendor/snowball/tests/errors/missing-ket-backwardmode.stderr +1 -0
- data/vendor/snowball/tests/errors/missing-ket.sbl +7 -0
- data/vendor/snowball/tests/errors/missing-ket.stderr +6 -0
- data/vendor/snowball/tests/errors/notdefined.sbl +4 -0
- data/vendor/snowball/tests/errors/notdefined.stderr +2 -0
- data/vendor/snowball/tests/errors/string-omitted.sbl +5 -0
- data/vendor/snowball/tests/errors/string-omitted.stderr +1 -0
- data/vendor/snowball/tests/errors/undeclared.sbl +20 -0
- data/vendor/snowball/tests/errors/undeclared.stderr +9 -0
- data/vendor/snowball/tests/errors/unexpected-token.sbl +24 -0
- data/vendor/snowball/tests/errors/unexpected-token.stderr +17 -0
- data/vendor/snowball/tests/errors/wrongdirection.sbl +14 -0
- data/vendor/snowball/tests/errors/wrongdirection.stderr +1 -0
- data/vendor/snowball/tests/runtime/among.sbl +19 -0
- data/vendor/snowball/tests/runtime/arithmeticexpr.sbl +86 -0
- data/vendor/snowball/tests/runtime/attachinsert.sbl +47 -0
- data/vendor/snowball/tests/runtime/booleans.sbl +19 -0
- data/vendor/snowball/tests/runtime/externals.sbl +22 -0
- data/vendor/snowball/tests/runtime/hop.sbl +12 -0
- data/vendor/snowball/tests/runtime/integertests.sbl +60 -0
- data/vendor/snowball/tests/runtime/intlimits.sbl +25 -0
- data/vendor/snowball/tests/runtime/naming.sbl +20 -0
- data/vendor/snowball/tests/runtime/not.sbl +30 -0
- data/vendor/snowball/tests/runtime/or.sbl +17 -0
- data/vendor/snowball/tests/runtime/repeat.sbl +16 -0
- data/vendor/snowball/tests/runtime/setlimit.sbl +24 -0
- data/vendor/snowball/tests/runtime/sizelen.sbl +56 -0
- data/vendor/snowball/tests/runtime/slice.sbl +27 -0
- data/vendor/snowball/tests/runtime/stringdollar.sbl +39 -0
- data/vendor/snowball/tests/runtime/strings.sbl +66 -0
- data/vendor/snowball/tests/runtime/test.sbl +19 -0
- data/vendor/snowball/tests/stemtest.c +41 -1
- data/vendor/snowball/tests/syntax/canon.sbl +32 -0
- data/vendor/snowball/tests/syntax/canon.stderr +0 -0
- data/vendor/snowball/tests/syntax/canon.syntax +57 -0
- data/vendor/snowball/tests/syntax/emptyprogram.sbl +2 -0
- data/vendor/snowball/tests/syntax/emptyprogram.syntax +0 -0
- data/vendor/snowball/tests/syntax/groupings.sbl +11 -0
- data/vendor/snowball/tests/syntax/inline.sbl +144 -0
- data/vendor/snowball/tests/syntax/inline.stderr +0 -0
- data/vendor/snowball/tests/syntax/inline.syntax +121 -0
- data/vendor/snowball/tests/syntax/legacy.sbl +17 -0
- data/vendor/snowball/tests/syntax/legacy.stderr +5 -0
- data/vendor/snowball/tests/syntax/legacy.syntax +19 -0
- data/vendor/snowball/tests/syntax/loops.sbl +14 -0
- data/vendor/snowball/tests/syntax/loops.stderr +9 -0
- data/vendor/snowball/tests/syntax/loops.syntax +29 -0
- data/vendor/snowball/tests/syntax/noops.sbl +76 -0
- data/vendor/snowball/tests/syntax/noops.stderr +27 -0
- data/vendor/snowball/tests/syntax/noops.syntax +135 -0
- data/vendor/snowball/tests/syntax/simplifyae.sbl +21 -0
- data/vendor/snowball/tests/syntax/simplifyae.stderr +0 -0
- data/vendor/snowball/tests/syntax/simplifyae.syntax +39 -0
- data/vendor/snowball/tests/syntax/unused.sbl +18 -0
- data/vendor/snowball/tests/syntax/unused.stderr +7 -0
- data/vendor/snowball/tests/syntax/unused.syntax +3 -0
- data/vendor/snowball/zig/env.zig +599 -0
- data/vendor/snowball/zig/generate_algorithms.pl +19 -0
- data/vendor/snowball/zig/stemwords.zig +123 -0
- metadata +102 -4
- data/vendor/snowball/compiler/syswords.h +0 -86
- data/vendor/snowball/runtime/header.h +0 -62
|
@@ -1,103 +1,131 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import process from 'node:process';
|
|
3
|
+
import readline from 'node:readline';
|
|
3
4
|
|
|
4
5
|
function usage() {
|
|
5
|
-
console.log(
|
|
6
|
-
console.log("The input file consists of a list of words to be stemmed, one per");
|
|
7
|
-
console.log("line. Words should be in lower case.\n");
|
|
8
|
-
console.log("If -c is given, the argument is the character encoding of the input");
|
|
9
|
-
console.log("and output files. If it is omitted, the UTF-8 encoding is used.\n");
|
|
10
|
-
console.log("The output file consists of the stemmed words, one per line.\n");
|
|
11
|
-
console.log("-h displays this help");
|
|
12
|
-
}
|
|
6
|
+
console.log(`usage: stemwords.js [-l <language>] [-i <input file>] [-o <output file>] [-c <character encoding>] [-h]
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
The input file consists of a list of words to be stemmed, one per line.
|
|
9
|
+
Words should be in lower case.
|
|
10
|
+
|
|
11
|
+
Language defaults to "English", input to stdin, and output to stdout.
|
|
12
|
+
|
|
13
|
+
If -c is given, the argument is the character encoding of the input and
|
|
14
|
+
output files. If it is omitted, the UTF-8 encoding is used.
|
|
15
|
+
|
|
16
|
+
The output file consists of the stemmed words, one per line.
|
|
17
|
+
|
|
18
|
+
-h displays this help`);
|
|
17
19
|
}
|
|
18
|
-
|
|
20
|
+
|
|
19
21
|
{
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
let input = '';
|
|
23
|
+
let output = '';
|
|
24
|
+
let encoding = 'utf8';
|
|
25
|
+
let language = 'English';
|
|
26
|
+
let usage_error = false;
|
|
27
|
+
// Skip the first two entries of argv which are the interpreter
|
|
28
|
+
// and the script name.
|
|
29
|
+
//
|
|
30
|
+
// deno doesn't allow modifying process.argv so we need to make
|
|
31
|
+
// a copy here.
|
|
32
|
+
const argv = process.argv.slice(2);
|
|
33
|
+
while (argv.length > 0)
|
|
26
34
|
{
|
|
27
|
-
|
|
35
|
+
const arg = argv.shift();
|
|
28
36
|
switch (arg)
|
|
29
37
|
{
|
|
30
38
|
case "-h":
|
|
31
|
-
|
|
32
|
-
process.
|
|
39
|
+
usage();
|
|
40
|
+
process.exit(0);
|
|
33
41
|
break;
|
|
34
42
|
case "-l":
|
|
35
|
-
if (
|
|
43
|
+
if (argv.length === 0)
|
|
36
44
|
{
|
|
37
|
-
|
|
45
|
+
usage_error = true;
|
|
38
46
|
break;
|
|
39
47
|
}
|
|
40
|
-
language =
|
|
48
|
+
language = argv.shift();
|
|
41
49
|
break;
|
|
42
50
|
case "-i":
|
|
43
|
-
if (
|
|
51
|
+
if (argv.length === 0)
|
|
44
52
|
{
|
|
45
|
-
|
|
53
|
+
usage_error = true;
|
|
46
54
|
break;
|
|
47
55
|
}
|
|
48
|
-
input =
|
|
56
|
+
input = argv.shift();
|
|
49
57
|
break;
|
|
50
58
|
case "-o":
|
|
51
|
-
if (
|
|
59
|
+
if (argv.length === 0)
|
|
52
60
|
{
|
|
53
|
-
|
|
61
|
+
usage_error = true;
|
|
54
62
|
break;
|
|
55
63
|
}
|
|
56
|
-
output =
|
|
64
|
+
output = argv.shift();
|
|
57
65
|
break;
|
|
58
66
|
case "-c":
|
|
59
|
-
if (
|
|
67
|
+
if (argv.length === 0)
|
|
60
68
|
{
|
|
61
|
-
|
|
69
|
+
usage_error = true;
|
|
62
70
|
break;
|
|
63
71
|
}
|
|
64
|
-
encoding =
|
|
72
|
+
encoding = argv.shift();
|
|
65
73
|
break;
|
|
74
|
+
default:
|
|
75
|
+
console.log('Unknown command line option: ' + arg + '\n');
|
|
76
|
+
usage_error = true;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (usage_error)
|
|
80
|
+
{
|
|
81
|
+
usage();
|
|
82
|
+
process.exit(1);
|
|
66
83
|
}
|
|
67
84
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
85
|
+
|
|
86
|
+
const stemmer = await create(language);
|
|
87
|
+
let istream, ostream;
|
|
88
|
+
if (input !== '') {
|
|
89
|
+
istream = fs.createReadStream(input, encoding);
|
|
90
|
+
} else {
|
|
91
|
+
istream = process.stdin;
|
|
92
|
+
if (istream.setEncoding) istream.setEncoding(encoding);
|
|
71
93
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
94
|
+
if (output !== '') {
|
|
95
|
+
ostream = fs.createWriteStream(output, encoding);
|
|
96
|
+
} else {
|
|
97
|
+
ostream = process.stdout;
|
|
98
|
+
if (ostream.setEncoding) ostream.setEncoding(encoding);
|
|
75
99
|
}
|
|
100
|
+
|
|
101
|
+
stemming(stemmer, istream, ostream);
|
|
76
102
|
}
|
|
77
103
|
|
|
78
|
-
// function stemming (
|
|
79
|
-
function stemming (
|
|
104
|
+
// function stemming (stemmer : Stemmer, input : Stream, output : Stream) {
|
|
105
|
+
function stemming (stemmer, input, output) {
|
|
80
106
|
const lines = readline.createInterface({
|
|
81
|
-
input:
|
|
107
|
+
input: input,
|
|
82
108
|
terminal: false
|
|
83
109
|
});
|
|
84
|
-
var out = fs.createWriteStream(output, encoding);
|
|
85
|
-
var stemmer = create(lang);
|
|
86
110
|
lines.on('line', (original) => {
|
|
87
|
-
|
|
111
|
+
output.write(stemmer.stemWord(original) + '\n');
|
|
88
112
|
});
|
|
89
113
|
}
|
|
90
114
|
|
|
91
|
-
function create (name) {
|
|
92
|
-
|
|
93
|
-
if (
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
115
|
+
async function create (name) {
|
|
116
|
+
const lc_name = name.toLowerCase();
|
|
117
|
+
if (/\W/.test(lc_name) || lc_name === 'base') {
|
|
118
|
+
console.log('Unknown stemming language: ' + name + '\n');
|
|
119
|
+
usage();
|
|
120
|
+
process.exit(1);
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const filename = `../js_out/${lc_name}-stemmer.js`;
|
|
124
|
+
try {
|
|
125
|
+
// Load stemmer class from the module scope
|
|
126
|
+
const stemmerModule = await import(filename);
|
|
127
|
+
return new stemmerModule.default();
|
|
128
|
+
} catch (error) {
|
|
129
|
+
console.error(error);
|
|
99
130
|
}
|
|
100
|
-
console.log('Unknown stemming language: ' + name + '\n');
|
|
101
|
-
usage();
|
|
102
|
-
process.exit(1);
|
|
103
131
|
}
|
|
@@ -13,6 +13,7 @@ arabic UTF_8 arabic,ar,ara
|
|
|
13
13
|
armenian UTF_8 armenian,hy,hye,arm
|
|
14
14
|
basque UTF_8,ISO_8859_1 basque,eu,eus,baq
|
|
15
15
|
catalan UTF_8,ISO_8859_1 catalan,ca,cat
|
|
16
|
+
czech UTF_8,ISO_8859_2 czech,cs,ces,cze
|
|
16
17
|
danish UTF_8,ISO_8859_1 danish,da,dan
|
|
17
18
|
dutch UTF_8,ISO_8859_1 dutch,nl,dut,nld,kraaij_pohlmann
|
|
18
19
|
english UTF_8,ISO_8859_1 english,en,eng
|
|
@@ -30,6 +31,8 @@ italian UTF_8,ISO_8859_1 italian,it,ita
|
|
|
30
31
|
lithuanian UTF_8 lithuanian,lt,lit
|
|
31
32
|
nepali UTF_8 nepali,ne,nep
|
|
32
33
|
norwegian UTF_8,ISO_8859_1 norwegian,no,nor
|
|
34
|
+
polish UTF_8,ISO_8859_2 polish,pl,pol
|
|
35
|
+
persian UTF_8 persian,fa,fas,pers
|
|
33
36
|
portuguese UTF_8,ISO_8859_1 portuguese,pt,por
|
|
34
37
|
romanian UTF_8 romanian,ro,rum,ron
|
|
35
38
|
russian UTF_8,KOI8_R russian,ru,rus
|
|
@@ -39,6 +42,7 @@ swedish UTF_8,ISO_8859_1 swedish,sv,swe
|
|
|
39
42
|
tamil UTF_8 tamil,ta,tam
|
|
40
43
|
turkish UTF_8 turkish,tr,tur
|
|
41
44
|
yiddish UTF_8 yiddish,yi,yid
|
|
45
|
+
sesotho UTF_8 sesotho,st,sot
|
|
42
46
|
|
|
43
47
|
# Also include the traditional porter algorithm for english.
|
|
44
48
|
# The porter algorithm is included in the libstemmer distribution to assist
|
|
@@ -36,11 +36,8 @@ Type
|
|
|
36
36
|
Function OutGroupingBk(s : array of char; min, max : Integer) : Boolean;
|
|
37
37
|
Function GoOutGroupingBk(s : array of char; min, max : Integer) : Boolean;
|
|
38
38
|
|
|
39
|
-
Function EqS(
|
|
40
|
-
Function EqSBk(
|
|
41
|
-
|
|
42
|
-
Function EqV(s : AnsiString) : Boolean;
|
|
43
|
-
Function EqVBk(s : AnsiString) : Boolean;
|
|
39
|
+
Function EqS(s : AnsiString) : Boolean;
|
|
40
|
+
Function EqSBk(s : AnsiString) : Boolean;
|
|
44
41
|
|
|
45
42
|
Function FindAmong(v : array of TAmong; v_size : Integer) : Integer;
|
|
46
43
|
Function FindAmongBk(v : array of TAmong; v_size : Integer) : Integer;
|
|
@@ -233,10 +230,11 @@ Begin
|
|
|
233
230
|
Result := False;
|
|
234
231
|
End;
|
|
235
232
|
|
|
236
|
-
Function TSnowballProgram.EqS(
|
|
237
|
-
Var I : Integer;
|
|
233
|
+
Function TSnowballProgram.EqS(s : AnsiString) : Boolean;
|
|
234
|
+
Var I, s_size : Integer;
|
|
238
235
|
Begin
|
|
239
236
|
Result := False;
|
|
237
|
+
s_size := Length(s);
|
|
240
238
|
|
|
241
239
|
If (FLimit - FCursor) < s_size Then Exit;
|
|
242
240
|
|
|
@@ -248,10 +246,11 @@ Begin
|
|
|
248
246
|
Result := True;
|
|
249
247
|
End;
|
|
250
248
|
|
|
251
|
-
Function TSnowballProgram.EqSBk(
|
|
252
|
-
Var I : Integer;
|
|
249
|
+
Function TSnowballProgram.EqSBk(s : AnsiString) : Boolean;
|
|
250
|
+
Var I, s_size : Integer;
|
|
253
251
|
Begin
|
|
254
252
|
Result := False;
|
|
253
|
+
s_size := Length(s);
|
|
255
254
|
|
|
256
255
|
if (FCursor - FBkLimit) < s_size Then Exit;
|
|
257
256
|
|
|
@@ -263,19 +262,9 @@ Begin
|
|
|
263
262
|
Result := True;
|
|
264
263
|
End;
|
|
265
264
|
|
|
266
|
-
Function TSnowballProgram.EqV(s : AnsiString) : Boolean;
|
|
267
|
-
Begin
|
|
268
|
-
Result := EqS(Length(s), s);
|
|
269
|
-
End;
|
|
270
|
-
|
|
271
|
-
Function TSnowballProgram.EqVBk(s : AnsiString) : Boolean;
|
|
272
|
-
Begin
|
|
273
|
-
Result := EqSBk(Length(s), s);
|
|
274
|
-
End;
|
|
275
|
-
|
|
276
265
|
Function TSnowballProgram.FindAmong(v : array of TAmong; v_size : Integer) : Integer;
|
|
277
266
|
Var i, i2, j, c, l, common_i, common_j, k, diff, common : Integer;
|
|
278
|
-
first_key_inspected
|
|
267
|
+
first_key_inspected : Boolean;
|
|
279
268
|
w : TAmong;
|
|
280
269
|
Begin
|
|
281
270
|
i := 0;
|
|
@@ -347,10 +336,9 @@ Begin
|
|
|
347
336
|
Exit;
|
|
348
337
|
End;
|
|
349
338
|
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
if (res) Then Begin
|
|
339
|
+
if w.Method Then
|
|
340
|
+
Begin
|
|
341
|
+
FCursor := c + Length(w.Str);
|
|
354
342
|
Result := w.Result;
|
|
355
343
|
Exit;
|
|
356
344
|
End;
|
|
@@ -367,7 +355,7 @@ End;
|
|
|
367
355
|
|
|
368
356
|
Function TSnowballProgram.FindAmongBk(v : array of TAmong; v_size : Integer) : Integer;
|
|
369
357
|
Var i, j, c, lb, common_i, common_j, k, diff, common, i2 : Integer;
|
|
370
|
-
first_key_inspected
|
|
358
|
+
first_key_inspected : Boolean;
|
|
371
359
|
w : TAmong;
|
|
372
360
|
Begin
|
|
373
361
|
i := 0;
|
|
@@ -433,11 +421,9 @@ Begin
|
|
|
433
421
|
Exit;
|
|
434
422
|
End;
|
|
435
423
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
FCursor := c - Length(w.Str);
|
|
439
|
-
If Res Then
|
|
424
|
+
if w.Method Then
|
|
440
425
|
Begin
|
|
426
|
+
FCursor := c - Length(w.Str);
|
|
441
427
|
Result := w.Result;
|
|
442
428
|
Exit;
|
|
443
429
|
End;
|
|
@@ -446,8 +432,8 @@ Begin
|
|
|
446
432
|
i := w.Index;
|
|
447
433
|
If i < 0 Then
|
|
448
434
|
Begin
|
|
449
|
-
|
|
450
|
-
|
|
435
|
+
Result := 0;
|
|
436
|
+
Exit;
|
|
451
437
|
End;
|
|
452
438
|
End;
|
|
453
439
|
End;
|
|
@@ -502,6 +488,7 @@ Procedure TSnowballProgram.SliceFrom(s : AnsiString);
|
|
|
502
488
|
Begin
|
|
503
489
|
SliceCheck();
|
|
504
490
|
ReplaceS(FBra, FKet, s);
|
|
491
|
+
FKet := FBra + Length(s);
|
|
505
492
|
End;
|
|
506
493
|
|
|
507
494
|
Function TSnowballProgram.AssignTo() : AnsiString;
|