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
data/vendor/snowball/GNUmakefile
CHANGED
|
@@ -2,19 +2,46 @@
|
|
|
2
2
|
|
|
3
3
|
# After changing this, run `make update_version` to update various sources
|
|
4
4
|
# which hard-code it.
|
|
5
|
-
SNOWBALL_VERSION = 3.
|
|
5
|
+
SNOWBALL_VERSION = 3.1.1
|
|
6
6
|
|
|
7
7
|
ifeq ($(OS),Windows_NT)
|
|
8
8
|
EXEEXT = .exe
|
|
9
9
|
endif
|
|
10
10
|
|
|
11
|
+
# `make SAVETMP=1` to save stemwords output for UTF-8 C stemmers on failure.
|
|
12
|
+
# Intended for use with snowball-data's stemmer-compare.
|
|
13
|
+
ifneq '$(SAVETMP)' ''
|
|
14
|
+
.NOTPARALLEL:
|
|
15
|
+
TEE_TO_TMP_TXT:=tee tmp.txt|
|
|
16
|
+
CLEAN_TMP_TXT:=rm -f tmp.txt
|
|
17
|
+
endif
|
|
18
|
+
|
|
19
|
+
# Use to hook up runtime tests (see `setup_runtime_tests` target below).
|
|
20
|
+
-include overrides.mk
|
|
21
|
+
|
|
22
|
+
# `make SNOWBALL_FLAGS=-comments` to generate target language code with
|
|
23
|
+
# comments indicating the corresponding lines in the .sbl source.
|
|
24
|
+
SNOWBALL_FLAGS ?=
|
|
25
|
+
SNOWBALL_COMPILE := ./snowball $(SNOWBALL_FLAGS)
|
|
26
|
+
|
|
27
|
+
# Ada
|
|
28
|
+
|
|
29
|
+
gprbuild ?= gprbuild
|
|
30
|
+
ada_src_main_dir = ada
|
|
31
|
+
ada_src_dir = $(ada_src_main_dir)/algorithms
|
|
32
|
+
|
|
33
|
+
# C
|
|
34
|
+
|
|
35
|
+
ARFLAGS = -cr
|
|
11
36
|
c_src_dir = src_c
|
|
12
37
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
38
|
+
# C++
|
|
39
|
+
|
|
40
|
+
CXX ?= c++
|
|
41
|
+
CXXFLAGS=-g -O2 -W -Wall -Wcast-qual -Wmissing-declarations -Wshadow $(WERROR)
|
|
42
|
+
cxx_src_dir = cxx
|
|
43
|
+
|
|
44
|
+
# C#
|
|
18
45
|
|
|
19
46
|
MONO ?= mono
|
|
20
47
|
MCS ?= mcs
|
|
@@ -22,43 +49,82 @@ csharp_src_main_dir = csharp/Snowball
|
|
|
22
49
|
csharp_src_dir = $(csharp_src_main_dir)/Algorithms
|
|
23
50
|
csharp_sample_dir = csharp/Stemwords
|
|
24
51
|
|
|
52
|
+
# Dart
|
|
53
|
+
|
|
54
|
+
DART ?= dart
|
|
55
|
+
DART_RUN_FLAGS ?= --enable-asserts
|
|
56
|
+
dart_src_main_dir = dart/lib
|
|
57
|
+
dart_src_dir = $(dart_src_main_dir)/ext
|
|
58
|
+
dart_runtime_dir = dart/lib/src
|
|
59
|
+
dart_gen_dir = dart/lib/gen
|
|
60
|
+
dart_example_dir = dart/example
|
|
61
|
+
dart_package_dir = dart
|
|
62
|
+
|
|
63
|
+
# Go
|
|
64
|
+
|
|
65
|
+
go ?= go
|
|
66
|
+
goflags ?= stemwords/algorithms.go stemwords/main.go
|
|
67
|
+
gofmt ?= gofmt
|
|
68
|
+
go_src_main_dir = go
|
|
69
|
+
go_src_dir = $(go_src_main_dir)/algorithms
|
|
70
|
+
|
|
71
|
+
# Java
|
|
72
|
+
|
|
73
|
+
JAVACFLAGS ?=
|
|
74
|
+
JAVAC ?= javac
|
|
75
|
+
JAVA ?= java -ea
|
|
76
|
+
java_src_main_dir = java/org/tartarus/snowball
|
|
77
|
+
java_src_dir = $(java_src_main_dir)/ext
|
|
78
|
+
|
|
79
|
+
# Javascript
|
|
80
|
+
|
|
81
|
+
js_output_dir = js_out
|
|
82
|
+
js_runtime_dir = javascript
|
|
83
|
+
js_sample_dir = sample
|
|
84
|
+
JSRUN ?= node
|
|
85
|
+
JSTYPE ?= global
|
|
86
|
+
|
|
87
|
+
# Pascal
|
|
88
|
+
|
|
25
89
|
FPC ?= fpc
|
|
26
90
|
# Enable warnings, info, notes; select "FILE:LINE:" diagnostic format.
|
|
27
91
|
FPC_FLAGS ?= -veiwnr
|
|
28
92
|
pascal_src_dir = pascal
|
|
29
93
|
|
|
94
|
+
# PHP
|
|
95
|
+
|
|
96
|
+
php_output_dir = php_out
|
|
97
|
+
php_runtime_dir = php
|
|
98
|
+
PHP ?= php
|
|
99
|
+
|
|
100
|
+
# Python
|
|
101
|
+
|
|
30
102
|
python ?= python3
|
|
31
103
|
python_output_dir = python_out
|
|
32
104
|
python_runtime_dir = snowballstemmer
|
|
33
105
|
python_sample_dir = sample
|
|
34
106
|
|
|
35
|
-
|
|
36
|
-
js_runtime_dir = javascript
|
|
37
|
-
js_sample_dir = sample
|
|
38
|
-
JSRUN ?= node
|
|
39
|
-
JSTYPE ?= global
|
|
107
|
+
# Rust
|
|
40
108
|
|
|
41
109
|
cargo ?= cargo
|
|
42
110
|
cargoflags ?= --release
|
|
43
111
|
rust_src_main_dir = rust/src
|
|
44
112
|
rust_src_dir = $(rust_src_main_dir)/snowball/algorithms
|
|
45
113
|
|
|
46
|
-
|
|
47
|
-
goflags ?= stemwords/algorithms.go stemwords/main.go
|
|
48
|
-
gofmt ?= gofmt
|
|
49
|
-
go_src_main_dir = go
|
|
50
|
-
go_src_dir = $(go_src_main_dir)/algorithms
|
|
114
|
+
# Zig
|
|
51
115
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
ada_src_dir = $(ada_src_main_dir)/algorithms
|
|
116
|
+
zig ?= zig
|
|
117
|
+
zig_src_dir = zig
|
|
55
118
|
|
|
56
119
|
DIFF = diff
|
|
57
120
|
ifeq ($(OS),Windows_NT)
|
|
58
121
|
DIFF = diff --strip-trailing-cr
|
|
59
122
|
endif
|
|
60
|
-
|
|
61
|
-
#
|
|
123
|
+
|
|
124
|
+
# If iconv isn't installed you can use iconv.py instead via:
|
|
125
|
+
#
|
|
126
|
+
# make check ICONV='python iconv.py'
|
|
127
|
+
ICONV ?= iconv
|
|
62
128
|
|
|
63
129
|
# Where the data files are located - assumes their repo is checked out as
|
|
64
130
|
# a sibling to this one.
|
|
@@ -78,44 +144,69 @@ endif
|
|
|
78
144
|
|
|
79
145
|
tarball_ext = .tar.gz
|
|
80
146
|
|
|
81
|
-
|
|
147
|
+
ALGORITHMS ?= algorithms
|
|
148
|
+
MODULES ?= libstemmer/modules.txt
|
|
149
|
+
|
|
150
|
+
# algorithms.mk is generated from the file $(MODULES) and defines:
|
|
82
151
|
# * libstemmer_algorithms
|
|
83
152
|
# * ISO_8859_1_algorithms
|
|
84
153
|
# * ISO_8859_2_algorithms
|
|
85
154
|
# * KOI8_R_algorithms
|
|
86
155
|
include algorithms.mk
|
|
87
156
|
|
|
88
|
-
other_algorithms
|
|
157
|
+
other_algorithms ?= lovins
|
|
89
158
|
|
|
90
159
|
all_algorithms = $(libstemmer_algorithms) $(other_algorithms)
|
|
91
160
|
|
|
92
|
-
COMPILER_SOURCES = compiler/
|
|
93
|
-
compiler/tokeniser.c \
|
|
94
|
-
compiler/analyser.c \
|
|
95
|
-
compiler/generator.c \
|
|
161
|
+
COMPILER_SOURCES = compiler/analyser.c \
|
|
96
162
|
compiler/driver.c \
|
|
163
|
+
compiler/generator.c \
|
|
164
|
+
compiler/generator_ada.c \
|
|
165
|
+
compiler/generator_c.c \
|
|
97
166
|
compiler/generator_csharp.c \
|
|
167
|
+
compiler/generator_dart.c \
|
|
168
|
+
compiler/generator_go.c \
|
|
98
169
|
compiler/generator_java.c \
|
|
99
170
|
compiler/generator_js.c \
|
|
100
171
|
compiler/generator_pascal.c \
|
|
172
|
+
compiler/generator_php.c \
|
|
101
173
|
compiler/generator_python.c \
|
|
102
174
|
compiler/generator_rust.c \
|
|
103
|
-
compiler/
|
|
104
|
-
compiler/
|
|
175
|
+
compiler/generator_zig.c \
|
|
176
|
+
compiler/space.c \
|
|
177
|
+
compiler/tokeniser.c
|
|
105
178
|
|
|
106
179
|
COMPILER_HEADERS = compiler/header.h \
|
|
107
|
-
compiler/
|
|
180
|
+
compiler/tokens.h
|
|
181
|
+
|
|
182
|
+
# C
|
|
108
183
|
|
|
109
184
|
RUNTIME_SOURCES = runtime/api.c \
|
|
110
185
|
runtime/utilities.c
|
|
111
186
|
|
|
112
187
|
RUNTIME_HEADERS = runtime/api.h \
|
|
113
|
-
runtime/
|
|
188
|
+
runtime/snowball_runtime.h
|
|
114
189
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
190
|
+
LIBSTEMMER_SOURCES = libstemmer/libstemmer.c
|
|
191
|
+
LIBSTEMMER_UTF8_SOURCES = libstemmer/libstemmer_utf8.c
|
|
192
|
+
LIBSTEMMER_HEADERS = include/libstemmer.h libstemmer/modules.h libstemmer/modules_utf8.h
|
|
193
|
+
LIBSTEMMER_EXTRA = $(MODULES) libstemmer/libstemmer_c.in
|
|
194
|
+
|
|
195
|
+
STEMWORDS_SOURCES = examples/stemwords.c
|
|
196
|
+
STEMTEST_SOURCES = tests/stemtest.c
|
|
197
|
+
|
|
198
|
+
# C++
|
|
199
|
+
|
|
200
|
+
CXX_STEMWORDS_SOURCES = $(cxx_src_dir)/stemwords.cxx
|
|
201
|
+
CXX_RUNTIME_SOURCES = $(cxx_src_dir)/stemmer.cxx $(cxx_src_dir)/utilities.cxx
|
|
202
|
+
CXX_SOURCES = $(libstemmer_algorithms:%=$(cxx_src_dir)/%_stemmer.cxx)
|
|
203
|
+
CXX_HEADERS = $(libstemmer_algorithms:%=$(cxx_src_dir)/%_stemmer.h)
|
|
204
|
+
|
|
205
|
+
CXX_STEMWORDS_OBJECTS = $(CXX_STEMWORDS_SOURCES:.cxx=.o)
|
|
206
|
+
CXX_RUNTIME_OBJECTS = $(patsubst %.c,%.o,$(patsubst %.cxx,%.o,$(CXX_RUNTIME_SOURCES)))
|
|
207
|
+
CXX_OBJECTS = $(CXX_SOURCES:.cxx=.o)
|
|
208
|
+
|
|
209
|
+
# C#
|
|
119
210
|
|
|
120
211
|
CSHARP_RUNTIME_SOURCES = csharp/Snowball/Among.cs \
|
|
121
212
|
csharp/Snowball/Stemmer.cs \
|
|
@@ -123,14 +214,45 @@ CSHARP_RUNTIME_SOURCES = csharp/Snowball/Among.cs \
|
|
|
123
214
|
|
|
124
215
|
CSHARP_STEMWORDS_SOURCES = csharp/Stemwords/Program.cs
|
|
125
216
|
|
|
217
|
+
# Dart
|
|
218
|
+
|
|
219
|
+
DART_RUNTIME_SOURCES = dart/lib/src/snowball.dart \
|
|
220
|
+
dart/lib/src/algorithms.dart
|
|
221
|
+
|
|
222
|
+
DART_PACKAGE_SOURCES = dart/lib/snowball.dart
|
|
223
|
+
|
|
224
|
+
DART_TEST_SOURCES = dart/example/test_app.dart
|
|
225
|
+
|
|
226
|
+
DART_PACKAGE_FILES = dart/pubspec.yaml \
|
|
227
|
+
dart/analysis_options.yaml \
|
|
228
|
+
dart/.gitignore
|
|
229
|
+
|
|
230
|
+
# Java
|
|
231
|
+
|
|
232
|
+
JAVA_RUNTIME_SOURCES = java/org/tartarus/snowball/Among.java \
|
|
233
|
+
java/org/tartarus/snowball/CharArraySequence.java \
|
|
234
|
+
java/org/tartarus/snowball/SnowballProgram.java \
|
|
235
|
+
java/org/tartarus/snowball/SnowballStemmer.java \
|
|
236
|
+
java/org/tartarus/snowball/TestApp.java
|
|
237
|
+
|
|
238
|
+
# Javascript
|
|
239
|
+
|
|
126
240
|
JS_RUNTIME_SOURCES = javascript/base-stemmer.js
|
|
127
241
|
|
|
128
242
|
JS_SAMPLE_SOURCES = javascript/stemwords.js
|
|
129
243
|
|
|
244
|
+
# Pascal
|
|
245
|
+
|
|
130
246
|
PASCAL_RUNTIME_SOURCES = pascal/SnowballProgram.pas
|
|
131
247
|
|
|
132
248
|
PASCAL_STEMWORDS_SOURCES = pascal/stemwords.dpr
|
|
133
249
|
|
|
250
|
+
# PHP
|
|
251
|
+
|
|
252
|
+
PHP_RUNTIME_SOURCES = php/base-stemmer.php
|
|
253
|
+
|
|
254
|
+
# Python
|
|
255
|
+
|
|
134
256
|
PYTHON_RUNTIME_SOURCES = python/snowballstemmer/basestemmer.py \
|
|
135
257
|
python/snowballstemmer/among.py
|
|
136
258
|
|
|
@@ -138,23 +260,16 @@ PYTHON_SAMPLE_SOURCES = python/testapp.py \
|
|
|
138
260
|
python/stemwords.py
|
|
139
261
|
|
|
140
262
|
PYTHON_PACKAGE_FILES = python/MANIFEST.in \
|
|
263
|
+
python/pyproject.toml \
|
|
141
264
|
python/setup.py \
|
|
142
265
|
python/setup.cfg
|
|
143
266
|
|
|
144
|
-
LIBSTEMMER_SOURCES = libstemmer/libstemmer.c
|
|
145
|
-
LIBSTEMMER_UTF8_SOURCES = libstemmer/libstemmer_utf8.c
|
|
146
|
-
LIBSTEMMER_HEADERS = include/libstemmer.h libstemmer/modules.h libstemmer/modules_utf8.h
|
|
147
|
-
LIBSTEMMER_EXTRA = libstemmer/modules.txt libstemmer/libstemmer_c.in
|
|
148
|
-
|
|
149
|
-
STEMWORDS_SOURCES = examples/stemwords.c
|
|
150
|
-
STEMTEST_SOURCES = tests/stemtest.c
|
|
151
|
-
|
|
152
267
|
PYTHON_STEMWORDS_SOURCE = python/stemwords.py
|
|
153
268
|
|
|
154
269
|
COMMON_FILES = COPYING \
|
|
155
270
|
NEWS
|
|
156
271
|
|
|
157
|
-
ALL_ALGORITHM_FILES = $(all_algorithms
|
|
272
|
+
ALL_ALGORITHM_FILES = $(all_algorithms:%=$(ALGORITHMS)/%.sbl)
|
|
158
273
|
C_LIB_SOURCES = $(libstemmer_algorithms:%=$(c_src_dir)/stem_UTF_8_%.c) \
|
|
159
274
|
$(KOI8_R_algorithms:%=$(c_src_dir)/stem_KOI8_R_%.c) \
|
|
160
275
|
$(ISO_8859_1_algorithms:%=$(c_src_dir)/stem_ISO_8859_1_%.c) \
|
|
@@ -167,16 +282,22 @@ C_OTHER_SOURCES = $(other_algorithms:%=$(c_src_dir)/stem_UTF_8_%.c)
|
|
|
167
282
|
C_OTHER_HEADERS = $(other_algorithms:%=$(c_src_dir)/stem_UTF_8_%.h)
|
|
168
283
|
JAVA_SOURCES = $(libstemmer_algorithms:%=$(java_src_dir)/%Stemmer.java)
|
|
169
284
|
CSHARP_SOURCES = $(libstemmer_algorithms:%=$(csharp_src_dir)/%Stemmer.generated.cs)
|
|
285
|
+
DART_SOURCES = $(libstemmer_algorithms:%=$(dart_src_dir)/%_stemmer.dart) \
|
|
286
|
+
$(dart_runtime_dir)/algorithms.dart
|
|
170
287
|
PASCAL_SOURCES = $(ISO_8859_1_algorithms:%=$(pascal_src_dir)/%Stemmer.pas)
|
|
171
288
|
PYTHON_SOURCES = $(libstemmer_algorithms:%=$(python_output_dir)/%_stemmer.py) \
|
|
172
289
|
$(python_output_dir)/__init__.py
|
|
173
290
|
JS_SOURCES = $(libstemmer_algorithms:%=$(js_output_dir)/%-stemmer.js) \
|
|
174
291
|
$(js_output_dir)/base-stemmer.js
|
|
292
|
+
PHP_SOURCES = $(libstemmer_algorithms:%=$(php_output_dir)/%-stemmer.php) \
|
|
293
|
+
$(php_output_dir)/base-stemmer.php
|
|
175
294
|
RUST_SOURCES = $(libstemmer_algorithms:%=$(rust_src_dir)/%_stemmer.rs)
|
|
295
|
+
ZIG_SOURCES = $(libstemmer_algorithms:%=$(zig_src_dir)/%_stemmer.zig) \
|
|
296
|
+
$(zig_src_dir)/algorithms.zig
|
|
176
297
|
GO_SOURCES = $(libstemmer_algorithms:%=$(go_src_dir)/%_stemmer.go) \
|
|
177
298
|
$(go_src_main_dir)/stemwords/algorithms.go
|
|
178
|
-
ADA_SOURCES = $(libstemmer_algorithms:%=$(ada_src_dir)/stemmer
|
|
179
|
-
$(libstemmer_algorithms:%=$(ada_src_dir)/stemmer
|
|
299
|
+
ADA_SOURCES = $(libstemmer_algorithms:%=$(ada_src_dir)/stemmer-s_%.ads) \
|
|
300
|
+
$(libstemmer_algorithms:%=$(ada_src_dir)/stemmer-s_%.adb) \
|
|
180
301
|
$(ada_src_dir)/stemmer-factory.ads $(ada_src_dir)/stemmer-factory.adb
|
|
181
302
|
|
|
182
303
|
COMPILER_OBJECTS=$(COMPILER_SOURCES:.c=.o)
|
|
@@ -188,49 +309,61 @@ STEMTEST_OBJECTS=$(STEMTEST_SOURCES:.c=.o)
|
|
|
188
309
|
C_LIB_OBJECTS = $(C_LIB_SOURCES:.c=.o)
|
|
189
310
|
C_OTHER_OBJECTS = $(C_OTHER_SOURCES:.c=.o)
|
|
190
311
|
JAVA_CLASSES = $(JAVA_SOURCES:.java=.class)
|
|
191
|
-
JAVA_RUNTIME_CLASSES=$(
|
|
312
|
+
JAVA_RUNTIME_CLASSES=$(JAVA_RUNTIME_SOURCES:.java=.class)
|
|
192
313
|
|
|
193
|
-
CFLAGS=-g -O2 -W -Wall -Wmissing-prototypes -Wmissing-declarations -Wshadow $(WERROR)
|
|
314
|
+
CFLAGS=-g -O2 -W -Wall -Wcast-qual -Wmissing-prototypes -Wmissing-declarations -Wshadow $(WERROR)
|
|
194
315
|
CPPFLAGS=
|
|
195
316
|
|
|
196
317
|
INCLUDES=-Iinclude
|
|
197
318
|
|
|
198
319
|
all: snowball$(EXEEXT) libstemmer.a stemwords$(EXEEXT) $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS)
|
|
199
320
|
|
|
200
|
-
algorithms.mk: libstemmer/mkalgorithms.pl
|
|
201
|
-
libstemmer/mkalgorithms.pl algorithms.mk
|
|
321
|
+
algorithms.mk: GNUmakefile libstemmer/mkalgorithms.pl $(MODULES)
|
|
322
|
+
libstemmer/mkalgorithms.pl algorithms.mk $(MODULES)
|
|
202
323
|
|
|
203
324
|
clean:
|
|
204
|
-
rm -f $(
|
|
205
|
-
|
|
206
|
-
libstemmer.a stemwords$(EXEEXT) \
|
|
207
|
-
libstemmer/modules.h \
|
|
208
|
-
libstemmer/modules_utf8.h \
|
|
209
|
-
$(C_LIB_SOURCES) $(C_LIB_HEADERS) $(C_LIB_OBJECTS) \
|
|
210
|
-
$(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS) \
|
|
211
|
-
$(JAVA_SOURCES) $(JAVA_CLASSES) $(JAVA_RUNTIME_CLASSES) \
|
|
212
|
-
$(CSHARP_SOURCES) \
|
|
213
|
-
$(PASCAL_SOURCES) pascal/stemwords.dpr pascal/stemwords pascal/*.o pascal/*.ppu \
|
|
214
|
-
$(PYTHON_SOURCES) \
|
|
215
|
-
$(JS_SOURCES) \
|
|
216
|
-
$(RUST_SOURCES) \
|
|
217
|
-
$(ADA_SOURCES) ada/bin/generate ada/bin/stemwords \
|
|
218
|
-
stemtest$(EXEEXT) $(STEMTEST_OBJECTS) \
|
|
219
|
-
libstemmer/mkinc.mak libstemmer/mkinc_utf8.mak \
|
|
220
|
-
libstemmer/libstemmer.c libstemmer/libstemmer_utf8.c \
|
|
221
|
-
algorithms.mk
|
|
222
|
-
rm -rf ada/obj dist
|
|
223
|
-
-rmdir $(c_src_dir)
|
|
224
|
-
-rmdir $(python_output_dir)
|
|
225
|
-
-rmdir $(js_output_dir)
|
|
325
|
+
rm -f $(CLEANFILES)
|
|
326
|
+
rm -rf $(CLEANDIRS)
|
|
226
327
|
|
|
227
328
|
update_version:
|
|
228
|
-
perl -pi -e '
|
|
329
|
+
perl -pi -e '/SNOWBALL_VERSION/ && s/\d+\.\d+\.\d+/$(SNOWBALL_VERSION)/' \
|
|
229
330
|
compiler/header.h \
|
|
230
331
|
csharp/Snowball/AssemblyInfo.cs \
|
|
332
|
+
dart/pubspec.yaml \
|
|
231
333
|
python/setup.py
|
|
334
|
+
perl -pi -e 's/(libstemmer_c-)\d+\.\d+.\d+/$${1}$(SNOWBALL_VERSION)/' README.rst
|
|
335
|
+
|
|
336
|
+
# Generate and build for all target languages.
|
|
337
|
+
everything: ada all cxx csharp dart go java js pascal python rust zig
|
|
338
|
+
|
|
339
|
+
# Generate code for all languages. Override build tools to do as little code
|
|
340
|
+
# building as possible.
|
|
341
|
+
generate: gprbuild=perl -e '$$ARGV[0] eq "-Pgenerate" and unshift @ARGV, "gprbuild" and exec @ARGV' --
|
|
342
|
+
generate: CXX=:
|
|
343
|
+
generate: MCS=:
|
|
344
|
+
generate: DART=:
|
|
345
|
+
generate: go=:
|
|
346
|
+
generate: JAVAC=:
|
|
347
|
+
generate: FPC=:
|
|
348
|
+
generate: everything
|
|
232
349
|
|
|
233
|
-
|
|
350
|
+
# The directories where generated code goes for all languages.
|
|
351
|
+
ALL_CODE_DIRS := \
|
|
352
|
+
ada src_c cxx csharp dart go java js_out pascal python_out rust zig
|
|
353
|
+
|
|
354
|
+
# When runtime tests are enabled, this gets overridden by overrides.mk.
|
|
355
|
+
BASELINE ?= baseline
|
|
356
|
+
|
|
357
|
+
baseline-create: generate
|
|
358
|
+
rm -rf *.$(BASELINE)
|
|
359
|
+
for d in $(ALL_CODE_DIRS) ; do cp -a $$d $$d.$(BASELINE) ; done
|
|
360
|
+
rm -rf *.$(BASELINE)/*.o ada.$(BASELINE)/obj pascal.$(BASELINE)/*.ppu *.$(BASELINE)/stemwords$(EXEEXT)
|
|
361
|
+
find java.$(BASELINE) -name '*.class' -delete
|
|
362
|
+
|
|
363
|
+
baseline-diff:
|
|
364
|
+
@for d in $(ALL_CODE_DIRS) ; do diff -ru -x'*.o' -x'obj' -x'*.ppu' -x'*.class' -x'Cargo.lock' -x'target' $$d.$(BASELINE) $$d ; done
|
|
365
|
+
|
|
366
|
+
.PHONY: all clean update_version everything generate baseline-create baseline-diff
|
|
234
367
|
|
|
235
368
|
$(STEMMING_DATA)/% $(STEMMING_DATA_ABS)/%:
|
|
236
369
|
@[ -f '$@' ] || { echo '$@: Test data not found'; echo 'Checkout the snowball-data repo as "$(STEMMING_DATA_ABS)"'; exit 1; }
|
|
@@ -240,22 +373,58 @@ snowball$(EXEEXT): $(COMPILER_OBJECTS)
|
|
|
240
373
|
|
|
241
374
|
$(COMPILER_OBJECTS): $(COMPILER_HEADERS)
|
|
242
375
|
|
|
376
|
+
# List of files/glob patterns to remove on clean. This gets appended to by
|
|
377
|
+
# each target language section.
|
|
378
|
+
CLEANFILES := $(COMPILER_OBJECTS) $(RUNTIME_OBJECTS) \
|
|
379
|
+
$(LIBSTEMMER_OBJECTS) $(LIBSTEMMER_UTF8_OBJECTS) $(STEMWORDS_OBJECTS) snowball$(EXEEXT) \
|
|
380
|
+
libstemmer.a stemwords$(EXEEXT) \
|
|
381
|
+
libstemmer/modules.h \
|
|
382
|
+
libstemmer/modules_utf8.h \
|
|
383
|
+
stemtest$(EXEEXT) $(STEMTEST_OBJECTS) \
|
|
384
|
+
libstemmer/mkinc.mak libstemmer/mkinc_utf8.mak \
|
|
385
|
+
libstemmer/libstemmer.c libstemmer/libstemmer_utf8.c \
|
|
386
|
+
algorithms.mk
|
|
387
|
+
|
|
388
|
+
# List of directories to recursively remove on clean. This gets appended to by
|
|
389
|
+
# each target language section.
|
|
390
|
+
CLEANDIRS := dist
|
|
391
|
+
|
|
392
|
+
# Ada
|
|
393
|
+
|
|
394
|
+
ifneq '$(filter grouped-target,$(.FEATURES))' ''
|
|
395
|
+
# Grouped-targets were added in GNU make 4.3.
|
|
396
|
+
$(ada_src_dir)/stemmer-s_%.adb $(ada_src_dir)/stemmer-s_%.ads &: $(ALGORITHMS)/%.sbl snowball
|
|
397
|
+
else
|
|
398
|
+
# This will fail to recreate the .ads if it is deleted but the corresponding
|
|
399
|
+
# .adb is still present and up-to-date. That seems better than forcing a
|
|
400
|
+
# serial build with .NOTPARALLEL which it seems can only be applied to an
|
|
401
|
+
# entire makefile, not per-rule.
|
|
402
|
+
$(ada_src_dir)/stemmer-s_%.ads: $(ada_src_dir)/stemmer-s_%.adb
|
|
403
|
+
@:
|
|
404
|
+
|
|
405
|
+
$(ada_src_dir)/stemmer-s_%.adb: $(ALGORITHMS)/%.sbl snowball
|
|
406
|
+
endif
|
|
407
|
+
@mkdir -p $(ada_src_dir)
|
|
408
|
+
$(SNOWBALL_COMPILE) $< -ada -P 'S_$*' -o $@
|
|
409
|
+
|
|
410
|
+
# C
|
|
411
|
+
|
|
243
412
|
libstemmer/libstemmer.c: libstemmer/libstemmer_c.in
|
|
244
413
|
sed 's/@MODULES_H@/modules.h/' $^ >$@
|
|
245
414
|
|
|
246
415
|
libstemmer/libstemmer_utf8.c: libstemmer/libstemmer_c.in
|
|
247
416
|
sed 's/@MODULES_H@/modules_utf8.h/' $^ >$@
|
|
248
417
|
|
|
249
|
-
libstemmer/modules.h libstemmer/mkinc.mak: libstemmer/mkmodules.pl
|
|
250
|
-
libstemmer/mkmodules.pl $@ $(c_src_dir)
|
|
418
|
+
libstemmer/modules.h libstemmer/mkinc.mak: libstemmer/mkmodules.pl $(MODULES)
|
|
419
|
+
libstemmer/mkmodules.pl $@ $(c_src_dir) $(MODULES) libstemmer/mkinc.mak
|
|
251
420
|
|
|
252
|
-
libstemmer/modules_utf8.h libstemmer/mkinc_utf8.mak: libstemmer/mkmodules.pl
|
|
253
|
-
libstemmer/mkmodules.pl $@ $(c_src_dir)
|
|
421
|
+
libstemmer/modules_utf8.h libstemmer/mkinc_utf8.mak: libstemmer/mkmodules.pl $(MODULES)
|
|
422
|
+
libstemmer/mkmodules.pl $@ $(c_src_dir) $(MODULES) libstemmer/mkinc_utf8.mak utf8
|
|
254
423
|
|
|
255
424
|
libstemmer/libstemmer.o: libstemmer/modules.h $(C_LIB_HEADERS)
|
|
256
425
|
|
|
257
426
|
libstemmer.a: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS)
|
|
258
|
-
$(AR)
|
|
427
|
+
$(AR) $(ARFLAGS) $@ $^
|
|
259
428
|
|
|
260
429
|
examples/%.o: examples/%.c
|
|
261
430
|
$(CC) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) -c -o $@ $<
|
|
@@ -269,82 +438,140 @@ tests/%.o: tests/%.c
|
|
|
269
438
|
stemtest$(EXEEXT): $(STEMTEST_OBJECTS) libstemmer.a
|
|
270
439
|
$(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
|
|
271
440
|
|
|
272
|
-
|
|
273
|
-
$(MCS) -unsafe -target:exe -out:$@ $(CSHARP_STEMWORDS_SOURCES) $(CSHARP_RUNTIME_SOURCES) $(CSHARP_SOURCES)
|
|
274
|
-
|
|
275
|
-
pascal/stemwords.dpr: pascal/stemwords-template.dpr libstemmer/modules.txt
|
|
276
|
-
pascal/generate.pl $(ISO_8859_1_algorithms) < pascal/stemwords-template.dpr > $@
|
|
277
|
-
|
|
278
|
-
pascal/stemwords: $(PASCAL_STEMWORDS_SOURCES) $(PASCAL_RUNTIME_SOURCES) $(PASCAL_SOURCES)
|
|
279
|
-
$(FPC) $(FPC_FLAGS) -o$@ -Mdelphi $(PASCAL_STEMWORDS_SOURCES)
|
|
280
|
-
|
|
281
|
-
$(c_src_dir)/stem_UTF_8_%.c $(c_src_dir)/stem_UTF_8_%.h: algorithms/%.sbl snowball$(EXEEXT)
|
|
441
|
+
$(c_src_dir)/stem_UTF_8_%.c $(c_src_dir)/stem_UTF_8_%.h: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
282
442
|
@mkdir -p $(c_src_dir)
|
|
283
|
-
|
|
443
|
+
$(SNOWBALL_COMPILE) $< -o $@ -eprefix $*_UTF_8_ -r ../runtime -u
|
|
284
444
|
|
|
285
|
-
$(c_src_dir)/stem_KOI8_R_%.c $(c_src_dir)/stem_KOI8_R_%.h:
|
|
445
|
+
$(c_src_dir)/stem_KOI8_R_%.c $(c_src_dir)/stem_KOI8_R_%.h: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
286
446
|
@mkdir -p $(c_src_dir)
|
|
287
|
-
|
|
447
|
+
$(SNOWBALL_COMPILE) charsets/KOI8-R.sbl $< -o $@ -eprefix $*_KOI8_R_ -r ../runtime
|
|
288
448
|
|
|
289
|
-
$(c_src_dir)/stem_ISO_8859_1_%.c $(c_src_dir)/stem_ISO_8859_1_%.h:
|
|
449
|
+
$(c_src_dir)/stem_ISO_8859_1_%.c $(c_src_dir)/stem_ISO_8859_1_%.h: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
290
450
|
@mkdir -p $(c_src_dir)
|
|
291
|
-
|
|
451
|
+
$(SNOWBALL_COMPILE) $< -o $@ -eprefix $*_ISO_8859_1_ -r ../runtime
|
|
292
452
|
|
|
293
|
-
$(c_src_dir)/stem_ISO_8859_2_%.c $(c_src_dir)/stem_ISO_8859_2_%.h:
|
|
453
|
+
$(c_src_dir)/stem_ISO_8859_2_%.c $(c_src_dir)/stem_ISO_8859_2_%.h: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
294
454
|
@mkdir -p $(c_src_dir)
|
|
295
|
-
|
|
455
|
+
$(SNOWBALL_COMPILE) charsets/ISO-8859-2.sbl $< -o $@ -eprefix $*_ISO_8859_2_ -r ../runtime
|
|
296
456
|
|
|
297
457
|
$(c_src_dir)/stem_%.o: $(c_src_dir)/stem_%.c $(c_src_dir)/stem_%.h
|
|
298
458
|
$(CC) $(CFLAGS) $(INCLUDES) $(CPPFLAGS) -c -o $@ $<
|
|
299
459
|
|
|
300
|
-
|
|
301
|
-
@mkdir -p $(java_src_dir)
|
|
302
|
-
./snowball $< -j -o "$(java_src_dir)/$*Stemmer" -p org.tartarus.snowball.SnowballStemmer
|
|
460
|
+
# C++
|
|
303
461
|
|
|
304
|
-
$(
|
|
462
|
+
$(cxx_src_dir)/factory.h: libstemmer/modules.txt
|
|
463
|
+
$(cxx_src_dir)/generate_factory.pl $< > $@
|
|
464
|
+
|
|
465
|
+
$(cxx_src_dir)/stemwords$(EXEEXT): $(CXX_STEMWORDS_OBJECTS) $(CXX_RUNTIME_OBJECTS) $(CXX_OBJECTS)
|
|
466
|
+
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
|
|
467
|
+
|
|
468
|
+
$(cxx_src_dir)/%_stemmer.cxx $(cxx_src_dir)/%_stemmer.h: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
469
|
+
@mkdir -p $(cxx_src_dir)
|
|
470
|
+
$(SNOWBALL_COMPILE) -c++ -cheader '"stemmer.h"' $< -o $@ -r ../runtime -u
|
|
471
|
+
|
|
472
|
+
$(cxx_src_dir)/%stemmer.o: $(cxx_src_dir)/%stemmer.h
|
|
473
|
+
|
|
474
|
+
$(cxx_src_dir)/%.o: $(cxx_src_dir)/%.cxx
|
|
475
|
+
$(CXX) $(CXXFLAGS) $(INCLUDES) $(CPPFLAGS) -c -o $@ $<
|
|
476
|
+
|
|
477
|
+
$(cxx_src_dir)/stemmer.cxx: GNUmakefile $(cxx_src_dir)/generate_algorithms.pl $(MODULES)
|
|
478
|
+
$(cxx_src_dir)/generate_algorithms.pl $@ $(MODULES)
|
|
479
|
+
|
|
480
|
+
# C#
|
|
481
|
+
|
|
482
|
+
csharp_stemwords$(EXEEXT): $(CSHARP_STEMWORDS_SOURCES) $(CSHARP_RUNTIME_SOURCES) $(CSHARP_SOURCES)
|
|
483
|
+
$(MCS) -unsafe -target:exe -out:$@ $(CSHARP_STEMWORDS_SOURCES) $(CSHARP_RUNTIME_SOURCES) $(CSHARP_SOURCES)
|
|
484
|
+
|
|
485
|
+
$(csharp_src_dir)/%Stemmer.generated.cs: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
305
486
|
@mkdir -p $(csharp_src_dir)
|
|
306
|
-
|
|
487
|
+
$(SNOWBALL_COMPILE) $< -csharp -o $@
|
|
307
488
|
|
|
308
|
-
|
|
309
|
-
@mkdir -p $(pascal_src_dir)
|
|
310
|
-
./snowball $< -pascal -o "$(pascal_src_dir)/$*Stemmer"
|
|
489
|
+
# Dart
|
|
311
490
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
./snowball $< -py -o "$(python_output_dir)/$*_stemmer"
|
|
491
|
+
dart/lib/src/algorithms.dart: dart/generate_algorithms.pl libstemmer/modules.txt
|
|
492
|
+
dart/generate_algorithms.pl $(libstemmer_algorithms) > $@
|
|
315
493
|
|
|
316
|
-
$(
|
|
317
|
-
|
|
494
|
+
$(dart_src_dir)/%_stemmer.dart: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
495
|
+
@mkdir -p $(dart_src_dir)
|
|
496
|
+
$(SNOWBALL_COMPILE) $< -dart -o $@ -p SnowballStemmer
|
|
318
497
|
|
|
319
|
-
|
|
320
|
-
@mkdir -p $(rust_src_dir)
|
|
321
|
-
./snowball $< -rust -o "$(rust_src_dir)/$*_stemmer"
|
|
498
|
+
# Go
|
|
322
499
|
|
|
323
|
-
$(go_src_main_dir)/stemwords/algorithms.go: go/stemwords/generate.go
|
|
500
|
+
$(go_src_main_dir)/stemwords/algorithms.go: go/stemwords/generate.go $(MODULES)
|
|
324
501
|
@echo "Generating algorithms.go"
|
|
325
|
-
@cd go/stemwords && go generate
|
|
502
|
+
@cd go/stemwords && $(go) generate
|
|
326
503
|
|
|
327
|
-
$(go_src_dir)/%_stemmer.go:
|
|
504
|
+
$(go_src_dir)/%_stemmer.go: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
328
505
|
@mkdir -p $(go_src_dir)/$*
|
|
329
|
-
|
|
506
|
+
$(SNOWBALL_COMPILE) $< -go -o "$(go_src_dir)/$*/$*_stemmer" -P $*
|
|
330
507
|
$(gofmt) -s -w $(go_src_dir)/$*/$*_stemmer.go
|
|
331
508
|
|
|
332
|
-
|
|
509
|
+
# Java
|
|
510
|
+
|
|
511
|
+
$(java_src_dir)/%Stemmer.java: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
512
|
+
@mkdir -p $(java_src_dir)
|
|
513
|
+
$(SNOWBALL_COMPILE) $< -java -o $@ -p org.tartarus.snowball.SnowballStemmer
|
|
514
|
+
|
|
515
|
+
# Javascript
|
|
516
|
+
|
|
517
|
+
$(js_output_dir)/%-stemmer.js: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
333
518
|
@mkdir -p $(js_output_dir)
|
|
334
|
-
|
|
519
|
+
$(SNOWBALL_COMPILE) $< -js -o $@
|
|
335
520
|
|
|
336
521
|
$(js_output_dir)/base-stemmer.js: $(js_runtime_dir)/base-stemmer.js
|
|
337
522
|
@mkdir -p $(js_output_dir)
|
|
338
523
|
cp $< $@
|
|
339
524
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
525
|
+
# Pascal
|
|
526
|
+
|
|
527
|
+
pascal/stemwords.dpr: pascal/stemwords-template.dpr $(MODULES)
|
|
528
|
+
pascal/generate.pl $(ISO_8859_1_algorithms) < pascal/stemwords-template.dpr > $@
|
|
529
|
+
|
|
530
|
+
pascal/stemwords: $(PASCAL_STEMWORDS_SOURCES) $(PASCAL_RUNTIME_SOURCES) $(PASCAL_SOURCES)
|
|
531
|
+
$(FPC) $(FPC_FLAGS) -o$@ -Mdelphi $(PASCAL_STEMWORDS_SOURCES)
|
|
343
532
|
|
|
344
|
-
.
|
|
533
|
+
$(pascal_src_dir)/%Stemmer.pas: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
534
|
+
@mkdir -p $(pascal_src_dir)
|
|
535
|
+
$(SNOWBALL_COMPILE) $< -pascal -o $@
|
|
536
|
+
|
|
537
|
+
# PHP
|
|
538
|
+
|
|
539
|
+
$(php_output_dir)/%-stemmer.php: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
540
|
+
@mkdir -p $(php_output_dir)
|
|
541
|
+
$(SNOWBALL_COMPILE) $< -php -o $@
|
|
542
|
+
|
|
543
|
+
$(php_output_dir)/base-stemmer.php: $(php_runtime_dir)/base-stemmer.php
|
|
544
|
+
@mkdir -p $(php_output_dir)
|
|
545
|
+
cp $< $@
|
|
546
|
+
|
|
547
|
+
# Python
|
|
548
|
+
|
|
549
|
+
$(python_output_dir)/%_stemmer.py: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
550
|
+
@mkdir -p $(python_output_dir)
|
|
551
|
+
$(SNOWBALL_COMPILE) $< -python -eprefix _ -o $@
|
|
552
|
+
|
|
553
|
+
$(python_output_dir)/__init__.py: python/create_init.py $(libstemmer_algorithms:%=$(python_output_dir)/%_stemmer.py)
|
|
554
|
+
$(python) python/create_init.py $(python_output_dir)
|
|
555
|
+
|
|
556
|
+
# Rust
|
|
557
|
+
|
|
558
|
+
$(rust_src_dir)/%_stemmer.rs: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
559
|
+
@mkdir -p $(rust_src_dir)
|
|
560
|
+
$(SNOWBALL_COMPILE) $< -rust -o $@
|
|
561
|
+
|
|
562
|
+
# Zig
|
|
563
|
+
|
|
564
|
+
$(zig_src_dir)/%_stemmer.zig: $(ALGORITHMS)/%.sbl snowball$(EXEEXT)
|
|
565
|
+
@mkdir -p $(zig_src_dir)
|
|
566
|
+
$(SNOWBALL_COMPILE) $< -zig -o $@
|
|
567
|
+
|
|
568
|
+
$(zig_src_dir)/algorithms.zig: zig/generate_algorithms.pl libstemmer/modules.txt
|
|
569
|
+
zig/generate_algorithms.pl $(libstemmer_algorithms) > $@
|
|
570
|
+
|
|
571
|
+
.PHONY: dist dist_snowball dist_libstemmer_c dist_libstemmer_csharp dist_libstemmer_dart dist_libstemmer_java dist_libstemmer_js dist_libstemmer_python dist_libstemmer_php
|
|
345
572
|
|
|
346
573
|
# Make a full source distribution
|
|
347
|
-
dist: dist_snowball dist_libstemmer_c dist_libstemmer_csharp dist_libstemmer_java dist_libstemmer_js dist_libstemmer_python
|
|
574
|
+
dist: dist_snowball dist_libstemmer_c dist_libstemmer_csharp dist_libstemmer_dart dist_libstemmer_java dist_libstemmer_js dist_libstemmer_python dist_libstemmer_php
|
|
348
575
|
|
|
349
576
|
# Make a distribution of all the sources involved in snowball
|
|
350
577
|
dist_snowball: $(COMPILER_SOURCES) $(COMPILER_HEADERS) \
|
|
@@ -411,9 +638,10 @@ dist_libstemmer_c: \
|
|
|
411
638
|
echo 'endif' >> $${dest}/Makefile && \
|
|
412
639
|
echo 'CFLAGS=-O2' >> $${dest}/Makefile && \
|
|
413
640
|
echo 'CPPFLAGS=-Iinclude' >> $${dest}/Makefile && \
|
|
641
|
+
echo 'ARFLAGS=-cr' >> $${dest}/Makefile && \
|
|
414
642
|
echo 'all: libstemmer.a stemwords$$(EXEEXT)' >> $${dest}/Makefile && \
|
|
415
643
|
echo 'libstemmer.a: $$(snowball_sources:.c=.o)' >> $${dest}/Makefile && \
|
|
416
|
-
echo ' $$(AR)
|
|
644
|
+
echo ' $$(AR) $(ARFLAGS) $$@ $$^' >> $${dest}/Makefile && \
|
|
417
645
|
echo 'stemwords$$(EXEEXT): examples/stemwords.o libstemmer.a' >> $${dest}/Makefile && \
|
|
418
646
|
echo ' $$(CC) $$(CFLAGS) -o $$@ $$^' >> $${dest}/Makefile && \
|
|
419
647
|
echo 'clean:' >> $${dest}/Makefile && \
|
|
@@ -421,6 +649,59 @@ dist_libstemmer_c: \
|
|
|
421
649
|
(cd dist && tar zcf $${destname}$(tarball_ext) $${destname}) && \
|
|
422
650
|
rm -rf $${dest}
|
|
423
651
|
|
|
652
|
+
# Make a distribution of all the sources required to compile the C# library.
|
|
653
|
+
dist_libstemmer_csharp: $(RUNTIME_SOURCES) $(RUNTIME_HEADERS) \
|
|
654
|
+
$(COMMON_FILES) \
|
|
655
|
+
$(LIBSTEMMER_EXTRA) \
|
|
656
|
+
$(CSHARP_SOURCES)
|
|
657
|
+
destname=libstemmer_csharp-$(SNOWBALL_VERSION); \
|
|
658
|
+
dest=dist/$${destname}; \
|
|
659
|
+
rm -rf $${dest} && \
|
|
660
|
+
rm -f $${dest}$(tarball_ext) && \
|
|
661
|
+
mkdir -p $${dest} && \
|
|
662
|
+
cp -a doc/libstemmer_csharp_README $${dest}/README && \
|
|
663
|
+
mkdir -p $${dest}/$(csharp_src_dir) && \
|
|
664
|
+
cp -a $(CSHARP_SOURCES) $${dest}/$(csharp_src_dir) && \
|
|
665
|
+
mkdir -p $${dest}/$(csharp_src_main_dir) && \
|
|
666
|
+
cp -a $(CSHARP_RUNTIME_SOURCES) $${dest}/$(csharp_src_main_dir) && \
|
|
667
|
+
mkdir -p $${dest}/$(csharp_sample_dir) && \
|
|
668
|
+
cp -a $(CSHARP_STEMWORDS_SOURCES) $${dest}/$(csharp_sample_dir) && \
|
|
669
|
+
cp -a $(COMMON_FILES) $${dest} && \
|
|
670
|
+
(cd dist && tar zcf $${destname}$(tarball_ext) $${destname}) && \
|
|
671
|
+
rm -rf $${dest}
|
|
672
|
+
|
|
673
|
+
# Make a distribution of all the sources required to compile the Dart library.
|
|
674
|
+
dist_libstemmer_dart: $(RUNTIME_SOURCES) $(RUNTIME_HEADERS) \
|
|
675
|
+
$(COMMON_FILES) \
|
|
676
|
+
$(LIBSTEMMER_EXTRA) \
|
|
677
|
+
$(DART_SOURCES)
|
|
678
|
+
destname=libstemmer_dart-$(SNOWBALL_VERSION); \
|
|
679
|
+
dest=dist/$${destname}; \
|
|
680
|
+
rm -rf $${dest} && \
|
|
681
|
+
rm -f $${dest}$(tarball_ext) && \
|
|
682
|
+
mkdir -p $${dest} && \
|
|
683
|
+
mkdir -p $${dest}/$(dart_package_dir) && \
|
|
684
|
+
mkdir -p $${dest}/$(dart_src_dir) && \
|
|
685
|
+
mkdir -p $${dest}/$(dart_runtime_dir) && \
|
|
686
|
+
mkdir -p $${dest}/$(dart_src_main_dir) && \
|
|
687
|
+
mkdir -p $${dest}/$(dart_example_dir) && \
|
|
688
|
+
cp -a doc/libstemmer_dart_README $${dest}/$(dart_package_dir)/README.md && \
|
|
689
|
+
cp -a $(DART_SOURCES) $${dest}/$(dart_src_dir) && \
|
|
690
|
+
cp -a $(DART_RUNTIME_SOURCES) $${dest}/$(dart_runtime_dir) && \
|
|
691
|
+
cp -a $(DART_PACKAGE_SOURCES) $${dest}/$(dart_src_main_dir) && \
|
|
692
|
+
cp -a $(DART_TEST_SOURCES) $${dest}/$(dart_example_dir) && \
|
|
693
|
+
cp -a $(DART_PACKAGE_FILES) $${dest}/$(dart_package_dir) && \
|
|
694
|
+
cp -a $(COMMON_FILES) $${dest}/$(dart_package_dir) && \
|
|
695
|
+
mv $${dest}/$(dart_package_dir)/COPYING $${dest}/$(dart_package_dir)/LICENSE && \
|
|
696
|
+
mv $${dest}/$(dart_package_dir)/NEWS $${dest}/$(dart_package_dir)/CHANGELOG.md && \
|
|
697
|
+
(cd $${dest} && \
|
|
698
|
+
echo "$${dart_src_main_dir}/README.md" >> MANIFEST && \
|
|
699
|
+
ls $(dart_src_dir)/*.dart >> MANIFEST && \
|
|
700
|
+
ls $(dart_src_main_dir)/*.dart >> MANIFEST && \
|
|
701
|
+
ls $(dart_runtime_dir)/*.dart >> MANIFEST) && \
|
|
702
|
+
(cd dist && tar zcf $${destname}$(tarball_ext) $${destname}) && \
|
|
703
|
+
rm -rf $${dest}
|
|
704
|
+
|
|
424
705
|
# Make a distribution of all the sources required to compile the Java library.
|
|
425
706
|
dist_libstemmer_java: $(RUNTIME_SOURCES) $(RUNTIME_HEADERS) \
|
|
426
707
|
$(COMMON_FILES) \
|
|
@@ -435,7 +716,7 @@ dist_libstemmer_java: $(RUNTIME_SOURCES) $(RUNTIME_HEADERS) \
|
|
|
435
716
|
mkdir -p $${dest}/$(java_src_dir) && \
|
|
436
717
|
cp -a $(JAVA_SOURCES) $${dest}/$(java_src_dir) && \
|
|
437
718
|
mkdir -p $${dest}/$(java_src_main_dir) && \
|
|
438
|
-
cp -a $(
|
|
719
|
+
cp -a $(JAVA_RUNTIME_SOURCES) $${dest}/$(java_src_main_dir) && \
|
|
439
720
|
cp -a $(COMMON_FILES) $${dest} && \
|
|
440
721
|
(cd $${dest} && \
|
|
441
722
|
echo "README" >> MANIFEST && \
|
|
@@ -444,24 +725,37 @@ dist_libstemmer_java: $(RUNTIME_SOURCES) $(RUNTIME_HEADERS) \
|
|
|
444
725
|
(cd dist && tar zcf $${destname}$(tarball_ext) $${destname}) && \
|
|
445
726
|
rm -rf $${dest}
|
|
446
727
|
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
$(COMMON_FILES) \
|
|
450
|
-
$(LIBSTEMMER_EXTRA) \
|
|
451
|
-
$(CSHARP_SOURCES)
|
|
452
|
-
destname=libstemmer_csharp-$(SNOWBALL_VERSION); \
|
|
728
|
+
dist_libstemmer_js: $(JS_SOURCES) $(COMMON_FILES)
|
|
729
|
+
destname=jsstemmer-$(SNOWBALL_VERSION); \
|
|
453
730
|
dest=dist/$${destname}; \
|
|
454
731
|
rm -rf $${dest} && \
|
|
455
732
|
rm -f $${dest}$(tarball_ext) && \
|
|
456
733
|
mkdir -p $${dest} && \
|
|
457
|
-
|
|
458
|
-
mkdir -p $${dest}/$(
|
|
459
|
-
cp -a
|
|
460
|
-
|
|
461
|
-
cp -a $(
|
|
462
|
-
|
|
463
|
-
cp -a $(
|
|
734
|
+
mkdir -p $${dest}/$(js_runtime_dir) && \
|
|
735
|
+
mkdir -p $${dest}/$(js_sample_dir) && \
|
|
736
|
+
cp -a doc/libstemmer_js_README $${dest}/README.rst && \
|
|
737
|
+
cp -a $(COMMON_FILES) $${dest} && \
|
|
738
|
+
cp -a $(JS_RUNTIME_SOURCES) $${dest}/$(js_runtime_dir) && \
|
|
739
|
+
cp -a $(JS_SAMPLE_SOURCES) $${dest}/$(js_sample_dir) && \
|
|
740
|
+
cp -a $(JS_SOURCES) $${dest}/$(js_runtime_dir) && \
|
|
741
|
+
(cd $${dest} && \
|
|
742
|
+
ls README.rst $(COMMON_FILES) $(js_runtime_dir)/*.js $(js_sample_dir)/*.js > MANIFEST) && \
|
|
743
|
+
(cd dist && tar zcf $${destname}$(tarball_ext) $${destname}) && \
|
|
744
|
+
rm -rf $${dest}
|
|
745
|
+
|
|
746
|
+
dist_libstemmer_php: $(PHP_SOURCES) $(COMMON_FILES)
|
|
747
|
+
destname=libstemmer_php-$(SNOWBALL_VERSION); \
|
|
748
|
+
dest=dist/$${destname}; \
|
|
749
|
+
rm -rf $${dest} && \
|
|
750
|
+
rm -f $${dest}$(tarball_ext) && \
|
|
751
|
+
mkdir -p $${dest} && \
|
|
752
|
+
mkdir -p $${dest}/$(php_runtime_dir) && \
|
|
753
|
+
cp -a doc/libstemmer_php_README $${dest}/README.rst && \
|
|
464
754
|
cp -a $(COMMON_FILES) $${dest} && \
|
|
755
|
+
cp -a $(PHP_RUNTIME_SOURCES) $${dest}/$(php_runtime_dir) && \
|
|
756
|
+
cp -a $(PHP_SOURCES) $${dest}/$(php_runtime_dir) && \
|
|
757
|
+
(cd $${dest} && \
|
|
758
|
+
ls README.rst $(COMMON_FILES) $(php_runtime_dir)/*.php > MANIFEST) && \
|
|
465
759
|
(cd dist && tar zcf $${destname}$(tarball_ext) $${destname}) && \
|
|
466
760
|
rm -rf $${dest}
|
|
467
761
|
|
|
@@ -473,7 +767,7 @@ dist_libstemmer_python: $(PYTHON_SOURCES) $(COMMON_FILES)
|
|
|
473
767
|
mkdir -p $${dest} && \
|
|
474
768
|
mkdir -p $${dest}/src/$(python_runtime_dir) && \
|
|
475
769
|
mkdir -p $${dest}/src/$(python_sample_dir) && \
|
|
476
|
-
cp
|
|
770
|
+
cp $(MODULES) $${dest} && \
|
|
477
771
|
cp doc/libstemmer_python_README $${dest}/README.rst && \
|
|
478
772
|
cp -a $(PYTHON_SOURCES) $${dest}/src/$(python_runtime_dir) && \
|
|
479
773
|
cp -a $(PYTHON_SAMPLE_SOURCES) $${dest}/src/$(python_sample_dir) && \
|
|
@@ -482,31 +776,52 @@ dist_libstemmer_python: $(PYTHON_SOURCES) $(COMMON_FILES)
|
|
|
482
776
|
(cd $${dest} && $(python) -m build && cp dist/*.tar.gz dist/*.whl ..) && \
|
|
483
777
|
rm -rf $${dest}
|
|
484
778
|
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
779
|
+
###############################################################################
|
|
780
|
+
# Ada
|
|
781
|
+
###############################################################################
|
|
782
|
+
|
|
783
|
+
.PHONY: ada check_ada do_check_ada
|
|
784
|
+
|
|
785
|
+
ada: ada/bin/stemwords
|
|
786
|
+
|
|
787
|
+
check_ada: ada
|
|
788
|
+
$(MAKE) do_check_ada
|
|
789
|
+
|
|
790
|
+
do_check_ada: $(libstemmer_algorithms:%=check_ada_%)
|
|
791
|
+
|
|
792
|
+
check_ada_%: $(STEMMING_DATA_ABS)/%
|
|
793
|
+
@echo "Checking output of $* stemmer for Ada"
|
|
794
|
+
@cd ada && if test -f '$</voc.txt.gz' ; then \
|
|
795
|
+
gzip -dc '$</voc.txt.gz' |\
|
|
796
|
+
./bin/stemwords $* /dev/stdin $(PWD)/tmp.txt; \
|
|
797
|
+
gzip -dc '$</output.txt.gz'|$(DIFF) -u - $(PWD)/tmp.txt; \
|
|
798
|
+
else \
|
|
799
|
+
./bin/stemwords $* $</voc.txt /dev/stdout |\
|
|
800
|
+
$(DIFF) -u $</output.txt -; \
|
|
801
|
+
fi
|
|
802
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
803
|
+
|
|
804
|
+
$(ada_src_dir)/stemmer-factory.ads $(ada_src_dir)/stemmer-factory.adb: ada/bin/generate $(MODULES)
|
|
805
|
+
cd $(ada_src_dir) && ../bin/generate $(libstemmer_algorithms)
|
|
806
|
+
|
|
807
|
+
ada/bin/generate: ada/generate.gpr ada/generate/generate.adb
|
|
808
|
+
cd ada && $(gprbuild) -Pgenerate -p
|
|
809
|
+
|
|
810
|
+
ada/bin/stemwords: ada/stemwords.gpr $(ADA_SOURCES) ada/src/stemmer.adb ada/src/stemmer.ads ada/src/stemwords.adb
|
|
811
|
+
cd ada && $(gprbuild) -Pstemwords -p
|
|
812
|
+
|
|
813
|
+
CLEANDIRS += $(ada_src_dir) ada/bin ada/obj
|
|
502
814
|
|
|
503
815
|
###############################################################################
|
|
504
816
|
# C
|
|
505
817
|
###############################################################################
|
|
506
818
|
|
|
507
|
-
.PHONY: check check_stemtest check_utf8 check_iso_8859_1 check_iso_8859_2 check_koi8r
|
|
819
|
+
.PHONY: check check_compilertest check_stemtest check_utf8 check_iso_8859_1 check_iso_8859_2 check_koi8r
|
|
820
|
+
|
|
821
|
+
check: check_compilertest check_utf8 check_iso_8859_1 check_iso_8859_2 check_koi8r
|
|
508
822
|
|
|
509
|
-
|
|
823
|
+
check_compilertest: tests/compilertest
|
|
824
|
+
cd tests && ./compilertest
|
|
510
825
|
|
|
511
826
|
check_stemtest: stemtest$(EXEEXT)
|
|
512
827
|
./stemtest
|
|
@@ -519,74 +834,72 @@ check_iso_8859_2: $(ISO_8859_2_algorithms:%=check_iso_8859_2_%)
|
|
|
519
834
|
|
|
520
835
|
check_koi8r: $(KOI8_R_algorithms:%=check_koi8r_%)
|
|
521
836
|
|
|
837
|
+
# Allows e.g. make RUN_STEMWORDS='valgrind ./stemwords' check
|
|
838
|
+
RUN_STEMWORDS = ./stemwords
|
|
839
|
+
|
|
522
840
|
check_utf8_%: $(STEMMING_DATA)/% stemwords$(EXEEXT)
|
|
523
841
|
@echo "Checking output of $* stemmer with UTF-8"
|
|
524
842
|
@if test -f '$</voc.txt.gz' ; then \
|
|
525
|
-
gzip -dc '$</voc.txt.gz'
|
|
526
|
-
else \
|
|
527
|
-
./stemwords$(EXEEXT) -c UTF_8 -l $* -i $</voc.txt -o tmp.txt; \
|
|
528
|
-
fi
|
|
529
|
-
@if test -f '$</output.txt.gz' ; then \
|
|
843
|
+
gzip -dc '$</voc.txt.gz'|$(RUN_STEMWORDS) -c UTF_8 -l $* -o tmp.txt; \
|
|
530
844
|
gzip -dc '$</output.txt.gz'|$(DIFF) -u - tmp.txt; \
|
|
531
845
|
else \
|
|
532
|
-
$(
|
|
846
|
+
$(RUN_STEMWORDS) -c UTF_8 -l $* -i $</voc.txt |\
|
|
847
|
+
$(TEE_TO_TMP_TXT) \
|
|
848
|
+
$(DIFF) -u $</output.txt -; \
|
|
533
849
|
fi
|
|
534
|
-
@rm tmp.txt
|
|
850
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
851
|
+
@$(CLEAN_TMP_TXT)
|
|
535
852
|
|
|
536
853
|
check_iso_8859_1_%: $(STEMMING_DATA)/% stemwords$(EXEEXT)
|
|
537
854
|
@echo "Checking output of $* stemmer with ISO_8859_1"
|
|
538
855
|
@$(ICONV) -f UTF-8 -t ISO-8859-1 '$</voc.txt' |\
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
$(DIFF) -u
|
|
542
|
-
@rm tmp.txt
|
|
856
|
+
$(RUN_STEMWORDS) -c ISO_8859_1 -l $* |\
|
|
857
|
+
$(ICONV) -f ISO-8859-1 -t UTF-8 |\
|
|
858
|
+
$(DIFF) -u '$</output.txt' -
|
|
543
859
|
|
|
544
860
|
check_iso_8859_2_%: $(STEMMING_DATA)/% stemwords$(EXEEXT)
|
|
545
861
|
@echo "Checking output of $* stemmer with ISO_8859_2"
|
|
546
862
|
@$(ICONV) -f UTF-8 -t ISO-8859-2 '$</voc.txt' |\
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
$(DIFF) -u
|
|
550
|
-
@rm tmp.txt
|
|
863
|
+
$(RUN_STEMWORDS) -c ISO_8859_2 -l $* |\
|
|
864
|
+
$(ICONV) -f ISO-8859-2 -t UTF-8 |\
|
|
865
|
+
$(DIFF) -u '$</output.txt' -
|
|
551
866
|
|
|
552
867
|
check_koi8r_%: $(STEMMING_DATA)/% stemwords$(EXEEXT)
|
|
553
868
|
@echo "Checking output of $* stemmer with KOI8R"
|
|
554
869
|
@$(ICONV) -f UTF-8 -t KOI8-R '$</voc.txt' |\
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
$(DIFF) -u
|
|
558
|
-
|
|
870
|
+
$(RUN_STEMWORDS) -c KOI8_R -l $* |\
|
|
871
|
+
$(ICONV) -f KOI8-R -t UTF-8 |\
|
|
872
|
+
$(DIFF) -u '$</output.txt' -
|
|
873
|
+
|
|
874
|
+
CLEANDIRS += $(c_src_dir)
|
|
559
875
|
|
|
560
876
|
###############################################################################
|
|
561
|
-
#
|
|
877
|
+
# C++
|
|
562
878
|
###############################################################################
|
|
563
879
|
|
|
564
|
-
.PHONY:
|
|
565
|
-
|
|
566
|
-
java: $(JAVA_CLASSES) $(JAVA_RUNTIME_CLASSES)
|
|
880
|
+
.PHONY: cxx check_cxx do_check_cxx
|
|
567
881
|
|
|
568
|
-
|
|
569
|
-
cd java && $(JAVAC) $(JAVACFLAGS) $(patsubst java/%,%,$<)
|
|
882
|
+
cxx: $(CXX_SOURCES) $(CXX_HEADERS) $(cxx_src_dir)/stemwords$(EXEEXT)
|
|
570
883
|
|
|
571
|
-
|
|
572
|
-
$(MAKE)
|
|
884
|
+
check_cxx: cxx
|
|
885
|
+
$(MAKE) do_check_cxx
|
|
573
886
|
|
|
574
|
-
|
|
887
|
+
do_check_cxx: $(libstemmer_algorithms:%=check_cxx_%)
|
|
575
888
|
|
|
576
|
-
|
|
577
|
-
@echo "Checking output of $* stemmer for
|
|
578
|
-
@
|
|
889
|
+
check_cxx_%: $(STEMMING_DATA_ABS)/%
|
|
890
|
+
@echo "Checking output of $* stemmer for C++"
|
|
891
|
+
@if test -f '$</voc.txt.gz' ; then \
|
|
579
892
|
gzip -dc '$</voc.txt.gz' |\
|
|
580
|
-
$(
|
|
581
|
-
else \
|
|
582
|
-
$(JAVA) org/tartarus/snowball/TestApp $* $</voc.txt -o $(PWD)/tmp.txt; \
|
|
583
|
-
fi
|
|
584
|
-
@if test -f '$</output.txt.gz' ; then \
|
|
893
|
+
$(cxx_src_dir)/stemwords -l $* -o tmp.txt; \
|
|
585
894
|
gzip -dc '$</output.txt.gz'|$(DIFF) -u - tmp.txt; \
|
|
586
895
|
else \
|
|
587
|
-
$(
|
|
896
|
+
$(cxx_src_dir)/stemwords -l $* -i $</voc.txt |\
|
|
897
|
+
$(DIFF) -u $</output.txt - ;\
|
|
588
898
|
fi
|
|
589
|
-
@rm tmp.txt
|
|
899
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
900
|
+
|
|
901
|
+
CLEANFILES += $(CXX_SOURCES) $(CXX_HEADERS) cxx/*.o \
|
|
902
|
+
$(cxx_src_dir)/stemmer.cxx $(cxx_src_dir)/stemwords$(EXEEXT)
|
|
590
903
|
|
|
591
904
|
###############################################################################
|
|
592
905
|
# C#
|
|
@@ -605,37 +918,111 @@ check_csharp_%: $(STEMMING_DATA_ABS)/%
|
|
|
605
918
|
@echo "Checking output of $* stemmer for C#"
|
|
606
919
|
@if test -f '$</voc.txt.gz' ; then \
|
|
607
920
|
gzip -dc '$</voc.txt.gz' |\
|
|
608
|
-
$(MONO) csharp_stemwords$(EXEEXT) -l $* -
|
|
921
|
+
$(MONO) csharp_stemwords$(EXEEXT) -l $* -o tmp.txt; \
|
|
922
|
+
gzip -dc '$</output.txt.gz'|$(DIFF) -u - tmp.txt; \
|
|
609
923
|
else \
|
|
610
|
-
$(MONO) csharp_stemwords$(EXEEXT) -l $* -i $</voc.txt
|
|
924
|
+
$(MONO) csharp_stemwords$(EXEEXT) -l $* -i $</voc.txt |\
|
|
925
|
+
$(DIFF) -u $</output.txt - ;\
|
|
611
926
|
fi
|
|
612
|
-
@if test -f '$</
|
|
613
|
-
|
|
927
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
928
|
+
|
|
929
|
+
CLEANFILES += $(CSHARP_SOURCES) csharp_stemwords$(EXEEXT)
|
|
930
|
+
|
|
931
|
+
###############################################################################
|
|
932
|
+
# Dart
|
|
933
|
+
###############################################################################
|
|
934
|
+
|
|
935
|
+
.PHONY: dart check_dart do_check_dart
|
|
936
|
+
|
|
937
|
+
.SUFFIXES: .dart
|
|
938
|
+
|
|
939
|
+
dart: $(DART_SOURCES) dart/.dart_deps
|
|
940
|
+
|
|
941
|
+
dart/.dart_deps: dart/pubspec.yaml
|
|
942
|
+
@echo "Fetching Dart package dependencies..."
|
|
943
|
+
@cd dart && $(DART) pub get
|
|
944
|
+
@touch $@
|
|
945
|
+
|
|
946
|
+
check_dart: dart
|
|
947
|
+
$(MAKE) do_check_dart
|
|
948
|
+
|
|
949
|
+
do_check_dart: $(libstemmer_algorithms:%=check_dart_%)
|
|
950
|
+
|
|
951
|
+
check_dart_%: $(STEMMING_DATA_ABS)/%
|
|
952
|
+
@echo "Checking output of $* stemmer for Dart"
|
|
953
|
+
@cd dart && if test -f '$</voc.txt.gz' ; then \
|
|
954
|
+
gzip -dc '$</voc.txt.gz' |\
|
|
955
|
+
$(DART) run $(DART_RUN_FLAGS) example/test_app.dart $* -o $(PWD)/tmp.txt; \
|
|
956
|
+
gzip -dc '$</output.txt.gz'|$(DIFF) -u - $(PWD)/tmp.txt; \
|
|
614
957
|
else \
|
|
615
|
-
$(
|
|
958
|
+
$(DART) run $(DART_RUN_FLAGS) example/test_app.dart $* $</voc.txt |\
|
|
959
|
+
$(DIFF) -u $</output.txt - ;\
|
|
616
960
|
fi
|
|
617
|
-
@rm tmp.txt
|
|
961
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
962
|
+
|
|
963
|
+
CLEANDIRS += $(dart_src_dir) dart/.dart_tool
|
|
964
|
+
CLEANFILES += $(dart_runtime_dir)/algorithms.dart dart/.dart_deps dart/pubspec.lock
|
|
618
965
|
|
|
619
966
|
###############################################################################
|
|
620
|
-
#
|
|
967
|
+
# Go
|
|
621
968
|
###############################################################################
|
|
622
969
|
|
|
623
|
-
.PHONY:
|
|
970
|
+
.PHONY: go check_go do_check_go
|
|
624
971
|
|
|
625
|
-
|
|
972
|
+
go: $(GO_SOURCES)
|
|
626
973
|
|
|
627
|
-
|
|
628
|
-
$(MAKE)
|
|
974
|
+
check_go: go
|
|
975
|
+
$(MAKE) do_check_go
|
|
629
976
|
|
|
630
|
-
|
|
977
|
+
do_check_go: $(libstemmer_algorithms:%=check_go_%)
|
|
631
978
|
|
|
632
|
-
|
|
633
|
-
@echo "Checking output of $* stemmer
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
979
|
+
check_go_%: $(STEMMING_DATA_ABS)/%
|
|
980
|
+
@echo "Checking output of $* stemmer for Go"
|
|
981
|
+
@cd go && if test -f '$</voc.txt.gz' ; then \
|
|
982
|
+
gzip -dc '$</voc.txt.gz' |\
|
|
983
|
+
$(go) run $(goflags) -l $* -o $(PWD)/tmp.txt; \
|
|
984
|
+
gzip -dc '$</output.txt.gz'|$(DIFF) -u - $(PWD)/tmp.txt; \
|
|
985
|
+
else \
|
|
986
|
+
$(go) run $(goflags) -l $* -i $</voc.txt |\
|
|
987
|
+
$(DIFF) -u $</output.txt - ;\
|
|
988
|
+
fi
|
|
989
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
990
|
+
|
|
991
|
+
CLEANDIRS += $(go_src_dir)
|
|
992
|
+
CLEANFILES += $(go_src_main_dir)/stemwords/algorithms.go
|
|
993
|
+
|
|
994
|
+
###############################################################################
|
|
995
|
+
# Java
|
|
996
|
+
###############################################################################
|
|
997
|
+
|
|
998
|
+
.PHONY: java check_java do_check_java
|
|
999
|
+
|
|
1000
|
+
.SUFFIXES: .class .java
|
|
1001
|
+
|
|
1002
|
+
java: $(JAVA_CLASSES) $(JAVA_RUNTIME_CLASSES)
|
|
1003
|
+
|
|
1004
|
+
.java.class:
|
|
1005
|
+
cd java && $(JAVAC) $(JAVACFLAGS) $(patsubst java/%,%,$<)
|
|
1006
|
+
|
|
1007
|
+
check_java: java
|
|
1008
|
+
$(MAKE) do_check_java
|
|
1009
|
+
|
|
1010
|
+
do_check_java: $(libstemmer_algorithms:%=check_java_%)
|
|
1011
|
+
|
|
1012
|
+
check_java_%: $(STEMMING_DATA_ABS)/%
|
|
1013
|
+
@echo "Checking output of $* stemmer for Java"
|
|
1014
|
+
@cd java && if test -f '$</voc.txt.gz' ; then \
|
|
1015
|
+
gzip -dc '$</voc.txt.gz' |\
|
|
1016
|
+
$(JAVA) org/tartarus/snowball/TestApp $* -o $(PWD)/tmp.txt; \
|
|
1017
|
+
gzip -dc '$</output.txt.gz'|$(DIFF) -u - $(PWD)/tmp.txt; \
|
|
1018
|
+
else \
|
|
1019
|
+
$(JAVA) org/tartarus/snowball/TestApp $* $</voc.txt |\
|
|
1020
|
+
$(DIFF) -u $</output.txt - ;\
|
|
1021
|
+
fi
|
|
1022
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
1023
|
+
|
|
1024
|
+
CLEANDIRS += $(java_src_dir)
|
|
1025
|
+
CLEANFILES += $(JAVA_RUNTIME_CLASSES)
|
|
639
1026
|
|
|
640
1027
|
###############################################################################
|
|
641
1028
|
# Javascript
|
|
@@ -654,76 +1041,66 @@ check_js_%: export NODE_PATH=$(js_output_dir)
|
|
|
654
1041
|
check_js_%: $(STEMMING_DATA)/%
|
|
655
1042
|
@echo "Checking output of $* stemmer for JS"
|
|
656
1043
|
@if test -f '$</voc.txt.gz' ; then \
|
|
657
|
-
gzip -dc '$</voc.txt.gz'
|
|
658
|
-
|
|
659
|
-
rm tmp.in; \
|
|
660
|
-
else \
|
|
661
|
-
$(JSRUN) javascript/stemwords.js -l $* -i $</voc.txt -o tmp.txt; \
|
|
662
|
-
fi
|
|
663
|
-
@if test -f '$</output.txt.gz' ; then \
|
|
1044
|
+
gzip -dc '$</voc.txt.gz' |\
|
|
1045
|
+
$(JSRUN) javascript/stemwords.js -l $* -o tmp.txt; \
|
|
664
1046
|
gzip -dc '$</output.txt.gz'|$(DIFF) -u - tmp.txt; \
|
|
665
1047
|
else \
|
|
666
|
-
$(
|
|
1048
|
+
$(JSRUN) javascript/stemwords.js -l $* -i $</voc.txt |\
|
|
1049
|
+
$(DIFF) -u $</output.txt - ;\
|
|
667
1050
|
fi
|
|
668
|
-
@rm tmp.txt
|
|
1051
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
1052
|
+
|
|
1053
|
+
CLEANDIRS += $(js_output_dir)
|
|
669
1054
|
|
|
670
1055
|
###############################################################################
|
|
671
|
-
#
|
|
1056
|
+
# Pascal
|
|
672
1057
|
###############################################################################
|
|
673
1058
|
|
|
674
|
-
.PHONY:
|
|
1059
|
+
.PHONY: pascal check_pascal do_check_pascal
|
|
675
1060
|
|
|
676
|
-
|
|
1061
|
+
pascal: pascal/stemwords
|
|
677
1062
|
|
|
678
|
-
|
|
679
|
-
$(MAKE)
|
|
1063
|
+
check_pascal: pascal
|
|
1064
|
+
$(MAKE) do_check_pascal
|
|
680
1065
|
|
|
681
|
-
|
|
1066
|
+
do_check_pascal: $(ISO_8859_1_algorithms:%=check_pascal_%)
|
|
682
1067
|
|
|
683
|
-
|
|
684
|
-
@echo "Checking output of $* stemmer for
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
fi
|
|
692
|
-
@if test -f '$</output.txt.gz' ; then \
|
|
693
|
-
gzip -dc '$</output.txt.gz'|$(DIFF) -u - tmp.txt; \
|
|
694
|
-
else \
|
|
695
|
-
$(DIFF) -u $</output.txt tmp.txt; \
|
|
696
|
-
fi
|
|
697
|
-
@rm tmp.txt
|
|
1068
|
+
check_pascal_%: $(STEMMING_DATA_ABS)/%
|
|
1069
|
+
@echo "Checking output of $* stemmer with ISO_8859_1 for Pascal"
|
|
1070
|
+
@$(ICONV) -f UTF-8 -t ISO-8859-1 '$</voc.txt' |\
|
|
1071
|
+
./pascal/stemwords -l $* |\
|
|
1072
|
+
$(ICONV) -f ISO-8859-1 -t UTF-8 |\
|
|
1073
|
+
$(DIFF) -u $</output.txt -
|
|
1074
|
+
|
|
1075
|
+
CLEANFILES += $(PASCAL_SOURCES) pascal/stemwords.dpr pascal/stemwords pascal/*.o pascal/*.ppu
|
|
698
1076
|
|
|
699
1077
|
###############################################################################
|
|
700
|
-
#
|
|
1078
|
+
# PHP
|
|
701
1079
|
###############################################################################
|
|
702
1080
|
|
|
703
|
-
.PHONY:
|
|
1081
|
+
.PHONY: php check_php do_check_php
|
|
704
1082
|
|
|
705
|
-
|
|
1083
|
+
php: $(PHP_SOURCES)
|
|
706
1084
|
|
|
707
|
-
|
|
708
|
-
$(MAKE)
|
|
1085
|
+
check_php: php
|
|
1086
|
+
$(MAKE) do_check_php
|
|
709
1087
|
|
|
710
|
-
|
|
1088
|
+
do_check_php: $(libstemmer_algorithms:%=check_php_%)
|
|
711
1089
|
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
@
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
else \
|
|
719
|
-
$(go) run $(goflags) -l $* -i $</voc.txt -o $(PWD)/tmp.txt; \
|
|
720
|
-
fi
|
|
721
|
-
@if test -f '$</output.txt.gz' ; then \
|
|
1090
|
+
check_php_%: export PHP_PATH=$(php_output_dir)
|
|
1091
|
+
check_php_%: $(STEMMING_DATA)/%
|
|
1092
|
+
@echo "Checking output of $* stemmer for PHP"
|
|
1093
|
+
@if test -f '$</voc.txt.gz' ; then \
|
|
1094
|
+
gzip -dc '$</voc.txt.gz' |\
|
|
1095
|
+
$(PHP) php/stemwords.php $* > tmp.txt; \
|
|
722
1096
|
gzip -dc '$</output.txt.gz'|$(DIFF) -u - tmp.txt; \
|
|
723
1097
|
else \
|
|
724
|
-
$(
|
|
1098
|
+
$(PHP) php/stemwords.php $* < $</voc.txt |\
|
|
1099
|
+
$(DIFF) -u $</output.txt - ;\
|
|
725
1100
|
fi
|
|
726
|
-
@rm tmp.txt
|
|
1101
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
1102
|
+
|
|
1103
|
+
CLEANDIRS += $(php_output_dir)
|
|
727
1104
|
|
|
728
1105
|
###############################################################################
|
|
729
1106
|
# Python
|
|
@@ -737,20 +1114,16 @@ check_python: python
|
|
|
737
1114
|
$(MAKE) $(libstemmer_algorithms:%=check_python_%)
|
|
738
1115
|
|
|
739
1116
|
check_python_%: $(STEMMING_DATA_ABS)/%
|
|
740
|
-
@echo "Checking output of $* stemmer for Python (THIN_FACTOR=$(THIN_FACTOR))"
|
|
1117
|
+
@echo "Checking output of $* stemmer for Python$(if $(THIN_FACTOR), (THIN_FACTOR=$(THIN_FACTOR)))"
|
|
741
1118
|
@cd python_check && if test -f '$</voc.txt.gz' ; then \
|
|
742
|
-
gzip -dc '$</voc.txt.gz' $(THIN_TEST_DATA)
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
else \
|
|
746
|
-
$(python) stemwords.py -c utf8 -l $* -i $</voc.txt -o $(PWD)/tmp.txt; \
|
|
747
|
-
fi
|
|
748
|
-
@if test -f '$</output.txt.gz' ; then \
|
|
749
|
-
gzip -dc '$</output.txt.gz' $(THIN_TEST_DATA)|$(DIFF) -u - tmp.txt; \
|
|
1119
|
+
gzip -dc '$</voc.txt.gz' $(THIN_TEST_DATA) |\
|
|
1120
|
+
$(python) stemwords.py -c utf8 -l $* -o $(PWD)/tmp.txt; \
|
|
1121
|
+
gzip -dc '$</output.txt.gz' $(THIN_TEST_DATA)|$(DIFF) -u - $(PWD)/tmp.txt; \
|
|
750
1122
|
else \
|
|
751
|
-
$(
|
|
1123
|
+
$(python) stemwords.py -c utf8 -l $* -i $</voc.txt |\
|
|
1124
|
+
$(DIFF) -u $</output.txt - ;\
|
|
752
1125
|
fi
|
|
753
|
-
@rm tmp.txt
|
|
1126
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
754
1127
|
|
|
755
1128
|
check_python_stemwords: $(PYTHON_STEMWORDS_SOURCE) $(PYTHON_SOURCES)
|
|
756
1129
|
mkdir -p python_check
|
|
@@ -759,42 +1132,107 @@ check_python_stemwords: $(PYTHON_STEMWORDS_SOURCE) $(PYTHON_SOURCES)
|
|
|
759
1132
|
cp -a $(PYTHON_SOURCES) python_check/snowballstemmer
|
|
760
1133
|
cp -a $(PYTHON_STEMWORDS_SOURCE) python_check/
|
|
761
1134
|
|
|
1135
|
+
CLEANDIRS += python_check $(python_output_dir)
|
|
1136
|
+
|
|
762
1137
|
###############################################################################
|
|
763
|
-
#
|
|
1138
|
+
# Rust
|
|
764
1139
|
###############################################################################
|
|
765
1140
|
|
|
766
|
-
.PHONY:
|
|
1141
|
+
.PHONY: rust check_rust do_check_rust
|
|
767
1142
|
|
|
768
|
-
|
|
1143
|
+
rust: $(RUST_SOURCES)
|
|
769
1144
|
|
|
770
|
-
|
|
771
|
-
$(MAKE)
|
|
1145
|
+
check_rust: rust
|
|
1146
|
+
$(MAKE) do_check_rust
|
|
772
1147
|
|
|
773
|
-
|
|
1148
|
+
do_check_rust: $(libstemmer_algorithms:%=check_rust_%)
|
|
774
1149
|
|
|
775
|
-
|
|
776
|
-
@echo "Checking output of $* stemmer for
|
|
777
|
-
@cd
|
|
778
|
-
gzip -dc '$</voc.txt.gz'
|
|
779
|
-
|
|
780
|
-
|
|
1150
|
+
check_rust_%: $(STEMMING_DATA_ABS)/%
|
|
1151
|
+
@echo "Checking output of $* stemmer for Rust"
|
|
1152
|
+
@cd rust && if test -f '$</voc.txt.gz' ; then \
|
|
1153
|
+
gzip -dc '$</voc.txt.gz' |\
|
|
1154
|
+
$(cargo) run $(cargoflags) -- -l $* -o $(PWD)/tmp.txt; \
|
|
1155
|
+
gzip -dc '$</output.txt.gz'|$(DIFF) -u - $(PWD)/tmp.txt; \
|
|
781
1156
|
else \
|
|
782
|
-
|
|
1157
|
+
$(cargo) run $(cargoflags) -- -l $* -i $</voc.txt |\
|
|
1158
|
+
$(DIFF) -u $</output.txt - ;\
|
|
783
1159
|
fi
|
|
784
|
-
@if test -f '$</
|
|
1160
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
1161
|
+
|
|
1162
|
+
CLEANFILES += $(RUST_SOURCES) rust/Cargo.lock
|
|
1163
|
+
CLEANDIRS += rust/target
|
|
1164
|
+
|
|
1165
|
+
###############################################################################
|
|
1166
|
+
# Zig
|
|
1167
|
+
###############################################################################
|
|
1168
|
+
|
|
1169
|
+
.PHONY: zig check_zig do_check_zig
|
|
1170
|
+
|
|
1171
|
+
zig: $(ZIG_SOURCES)
|
|
1172
|
+
|
|
1173
|
+
zig/stemwords$(EXEEXT): $(ZIG_SOURCES) zig/stemwords.zig zig/env.zig
|
|
1174
|
+
cd $(zig_src_dir) && $(zig) build-exe -OReleaseFast stemwords.zig
|
|
1175
|
+
|
|
1176
|
+
check_zig: zig zig/stemwords$(EXEEXT)
|
|
1177
|
+
$(MAKE) do_check_zig
|
|
1178
|
+
|
|
1179
|
+
do_check_zig: $(libstemmer_algorithms:%=check_zig_%)
|
|
1180
|
+
|
|
1181
|
+
check_zig_%: $(STEMMING_DATA_ABS)/%
|
|
1182
|
+
@echo "Checking output of $* stemmer for Zig"
|
|
1183
|
+
@if test -f '$</voc.txt.gz' ; then \
|
|
1184
|
+
gzip -dc '$</voc.txt.gz' |\
|
|
1185
|
+
./zig/stemwords$(EXEEXT) -l $* -o tmp.txt; \
|
|
785
1186
|
gzip -dc '$</output.txt.gz'|$(DIFF) -u - tmp.txt; \
|
|
786
1187
|
else \
|
|
787
|
-
$(
|
|
1188
|
+
./zig/stemwords$(EXEEXT) -l $* -i $</voc.txt |\
|
|
1189
|
+
$(DIFF) -u $</output.txt - ;\
|
|
788
1190
|
fi
|
|
789
|
-
@rm tmp.txt
|
|
1191
|
+
@if test -f '$</voc.txt.gz' ; then rm tmp.txt ; fi
|
|
790
1192
|
|
|
791
|
-
$(
|
|
792
|
-
cd $(ada_src_dir) && ../bin/generate $(libstemmer_algorithms)
|
|
793
|
-
|
|
794
|
-
ada/bin/generate:
|
|
795
|
-
cd ada && $(gprbuild) -Pgenerate -p
|
|
1193
|
+
CLEANFILES += $(ZIG_SOURCES) zig/stemwords$(EXEEXT)
|
|
796
1194
|
|
|
797
|
-
|
|
798
|
-
|
|
1195
|
+
###############################################################################
|
|
1196
|
+
# Runtime tests
|
|
1197
|
+
###############################################################################
|
|
799
1198
|
|
|
800
|
-
|
|
1199
|
+
# Runtime test integration is currently a bit clunky, and you need to switch
|
|
1200
|
+
# your tree to a different state to run runtime tests.
|
|
1201
|
+
#
|
|
1202
|
+
# make clean setup_runtime_tests
|
|
1203
|
+
#
|
|
1204
|
+
# Then targets like `check_utf8`, `check_python`, etc will run the runtime
|
|
1205
|
+
# tests for a particular target language.
|
|
1206
|
+
#
|
|
1207
|
+
# Once you're done, switch the tree back to the normal state:
|
|
1208
|
+
#
|
|
1209
|
+
# make clean clean_runtime_tests
|
|
1210
|
+
|
|
1211
|
+
.PHONY: setup_runtime_tests clean_runtime_tests
|
|
1212
|
+
|
|
1213
|
+
RUNTIME_DATA_DIR := tmp_runtime_tests_snowball_data
|
|
1214
|
+
|
|
1215
|
+
setup_runtime_tests: clean_runtime_tests
|
|
1216
|
+
mkdir $(RUNTIME_DATA_DIR)
|
|
1217
|
+
r=$$PWD/$(RUNTIME_DATA_DIR) ;\
|
|
1218
|
+
cd tests/runtime && for t in *.sbl ; do \
|
|
1219
|
+
d=`echo "$$t"|sed 's/\.sbl$$//'` ;\
|
|
1220
|
+
mkdir $$r/$$d ;\
|
|
1221
|
+
echo ok > $$r/$$d/voc.txt ;\
|
|
1222
|
+
echo ok > $$r/$$d/output.txt ;\
|
|
1223
|
+
echo "$$d UTF_8,ISO_8859_1 $$d" >> $$r/modules.txt ;\
|
|
1224
|
+
done
|
|
1225
|
+
printf '%s:=%s\n' \
|
|
1226
|
+
ALGORITHMS 'tests/runtime' \
|
|
1227
|
+
BASELINE 'rbaseline' \
|
|
1228
|
+
MODULES '$(RUNTIME_DATA_DIR)/modules.txt' \
|
|
1229
|
+
other_algorithms '' \
|
|
1230
|
+
SNOWBALL_FLAGS '-comments' \
|
|
1231
|
+
STEMMING_DATA '$(RUNTIME_DATA_DIR)' \
|
|
1232
|
+
THIN_FACTOR '' \
|
|
1233
|
+
> overrides.mk
|
|
1234
|
+
rm -f algorithms.mk
|
|
1235
|
+
$(MAKE) algorithms.mk
|
|
1236
|
+
|
|
1237
|
+
clean_runtime_tests:
|
|
1238
|
+
rm -rf $(RUNTIME_DATA_DIR) overrides.mk
|