@@ -12,10 +12,10 @@ python_output_dir = python_out
12
12
python_runtime_dir = snowballstemmer
13
13
python_sample_dir = sample
14
14
15
- jsx_output_dir = jsx_out
16
- jsx_runtime_src_dir = jsx
17
- jsx_runtime_dir = lib
18
- jsx_sample_dir = sample
15
+ js_output_dir = js_out
16
+ js_runtime_src_dir = js
17
+ js_runtime_dir = lib
18
+ js_sample_dir = sample
19
19
20
20
cargo ?= cargo
21
21
cargoflags ?=
@@ -46,7 +46,7 @@ COMPILER_SOURCES = compiler/space.c \
46
46
compiler/generator.c \
47
47
compiler/driver.c \
48
48
compiler/generator_java.c \
49
- compiler/generator_jsx .c \
49
+ compiler/generator_js .c \
50
50
compiler/generator_python.c \
51
51
compiler/generator_rust.c
52
52
@@ -65,12 +65,12 @@ JAVARUNTIME_SOURCES = java/org/tartarus/snowball/Among.java \
65
65
java/org/tartarus/snowball/SnowballStemmer.java \
66
66
java/org/tartarus/snowball/TestApp.java
67
67
68
- JSX_RUNTIME_SOURCES = jsx /among.jsx \
69
- jsx /base-stemmer.jsx \
70
- jsx /stemmer.jsx
68
+ JS_RUNTIME_SOURCES = js /among.js \
69
+ js /base-stemmer.js \
70
+ js /stemmer.js
71
71
72
- JSX_SAMPLE_SOURCES = jsx /testapp.jsx \
73
- jsx /stemwords.jsx
72
+ JS_SAMPLE_SOURCES = js /testapp.js \
73
+ js /stemwords.js
74
74
75
75
PYTHON_RUNTIME_SOURCES = python/snowballstemmer/basestemmer.py \
76
76
python/snowballstemmer/among.py
@@ -88,7 +88,7 @@ LIBSTEMMER_EXTRA = libstemmer/modules.txt libstemmer/modules_utf8.txt libstemmer
88
88
89
89
STEMWORDS_SOURCES = examples/stemwords.c
90
90
91
- JSX_STEMWORDS_SOURCE = jsx /stemwords.jsx
91
+ JS_STEMWORDS_SOURCE = js /stemwords.js
92
92
93
93
PYTHON_STEMWORDS_SOURCE = python/stemwords.py
94
94
@@ -106,7 +106,7 @@ C_OTHER_HEADERS = $(other_algorithms:%=$(c_src_dir)/stem_UTF_8_%.h)
106
106
JAVA_SOURCES = $(libstemmer_algorithms:%=$(java_src_dir ) /%Stemmer.java )
107
107
PYTHON_SOURCES = $(libstemmer_algorithms:%=$(python_output_dir ) /%_stemmer.py ) \
108
108
$(python_output_dir ) /__init__.py
109
- JSX_SOURCES = $(libstemmer_algorithms:%=$(jsx_output_dir ) /%-stemmer.jsx )
109
+ JS_SOURCES = $(libstemmer_algorithms:%=$(js_output_dir ) /%-stemmer.js )
110
110
RUST_SOURCES = $(libstemmer_algorithms:%=$(rust_src_dir ) /%_stemmer.rs )
111
111
112
112
COMPILER_OBJECTS=$(COMPILER_SOURCES:.c =.o)
@@ -135,14 +135,14 @@ clean:
135
135
$(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS) \
136
136
$(JAVA_SOURCES) $(JAVA_CLASSES) $(JAVA_RUNTIME_CLASSES) \
137
137
$(PYTHON_SOURCES) \
138
- $(JSX_SOURCES) jsx_stemwords \
138
+ $(JS_SOURCES) \
139
139
$(RUST_SOURCES) \
140
140
libstemmer/mkinc.mak libstemmer/mkinc_utf8.mak \
141
141
libstemmer/libstemmer.c libstemmer/libstemmer_utf8.c
142
142
rm -rf dist
143
143
rmdir $(c_src_dir) || true
144
144
rmdir $(python_output_dir) || true
145
- rmdir $(jsx_output_dir ) || true
145
+ rmdir $(js_output_dir ) || true
146
146
147
147
snowball : $(COMPILER_OBJECTS )
148
148
$(CC ) -o $@ $^
@@ -169,9 +169,6 @@ libstemmer.o: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS)
169
169
stemwords : $(STEMWORDS_OBJECTS ) libstemmer.o
170
170
$(CC ) -o $@ $^
171
171
172
- jsx_stemwords : $(JSX_STEMWORDS_SOURCE ) $(JSX_SOURCES )
173
- jsx --executable node --output $@ --add-search-path $(jsx_output_dir ) --add-search-path $(jsx_runtime_src_dir ) $(JSX_STEMWORDS_SOURCE )
174
-
175
172
algorithms/% /stem_Unicode.sbl : algorithms/% /stem_ISO_8859_1.sbl
176
173
cp $^ $@
177
174
@@ -231,19 +228,19 @@ $(rust_src_dir)/%_stemmer.rs: algorithms/%/stem_Unicode.sbl snowball
231
228
echo " ./snowball $< -rust -o $$ {o}" ; \
232
229
./snowball $< -rust -o $$ {o}
233
230
234
- $(jsx_output_dir ) /% -stemmer.jsx : algorithms/% /stem_Unicode.sbl snowball
235
- @mkdir -p $(jsx_output_dir )
231
+ $(js_output_dir ) /% -stemmer.js : algorithms/% /stem_Unicode.sbl snowball
232
+ @mkdir -p $(js_output_dir )
236
233
@l=` echo " $<" | sed ' s!\(.*\)/stem_Unicode.sbl$$!\1!;s!^.*/!!' ` ; \
237
- o=" $( jsx_output_dir ) /$$ {l}-stemmer" ; \
238
- echo " ./snowball $< -jsx -o $$ {o} -p \" SnowballStemmer\" -n ` $( python) -c " print('$$ {l}'.title())" ` Stemmer" ; \
239
- ./snowball $< -jsx -o $$ {o} -p " BaseStemmer" -n ` $( python) -c " print('$$ {l}'.title())" ` Stemmer
234
+ o=" $( js_output_dir ) /$$ {l}-stemmer" ; \
235
+ echo " ./snowball $< -js -o $$ {o} -p \" SnowballStemmer\" -n ` $( python) -c " print('$$ {l}'.title())" ` Stemmer" ; \
236
+ ./snowball $< -js -o $$ {o} -p " BaseStemmer" -n ` $( python) -c " print('$$ {l}'.title())" ` Stemmer
240
237
241
238
splint : snowball.splint
242
239
snowball.splint : $(COMPILER_SOURCES )
243
240
splint $^ > $@ -weak
244
241
245
242
# Make a full source distribution
246
- dist : dist_snowball dist_libstemmer_c dist_libstemmer_java dist_libstemmer_jsx dist_libstemmer_python
243
+ dist : dist_snowball dist_libstemmer_c dist_libstemmer_java dist_libstemmer_js dist_libstemmer_python
247
244
248
245
# Make a distribution of all the sources involved in snowball
249
246
dist_snowball : $(COMPILER_SOURCES ) $(COMPILER_HEADERS ) \
@@ -351,22 +348,22 @@ dist_libstemmer_python: $(PYTHON_SOURCES)
351
348
(cd $$ {dest} && $( python) setup.py sdist && cp dist/* .tar.gz ..) && \
352
349
rm -rf $$ {dest}
353
350
354
- dist_libstemmer_jsx : $(JSX_SOURCES )
355
- destname=jsxstemmer ; \
351
+ dist_libstemmer_js : $(JS_SOURCES )
352
+ destname=jsstemmer ; \
356
353
dest=dist/$$ {destname}; \
357
354
rm -rf $$ {dest} && \
358
355
rm -f $$ {dest}.tgz && \
359
356
mkdir -p $$ {dest} && \
360
- mkdir -p $$ {dest}/$(jsx_runtime_dir ) && \
361
- mkdir -p $$ {dest}/$(jsx_sample_dir ) && \
362
- cp -a doc/libstemmer_jsx_README $$ {dest}/README && \
363
- cp -a $(JSX_RUNTIME_SOURCES ) $$ {dest}/$(jsx_runtime_dir ) && \
364
- cp -a $(JSX_SAMPLE_SOURCES ) $$ {dest}/$(jsx_sample_dir ) && \
365
- cp -a $(JSX_SOURCES ) $$ {dest}/$(jsx_runtime_dir ) && \
357
+ mkdir -p $$ {dest}/$(js_runtime_dir ) && \
358
+ mkdir -p $$ {dest}/$(js_sample_dir ) && \
359
+ cp -a doc/libstemmer_js_README $$ {dest}/README && \
360
+ cp -a $(JS_RUNTIME_SOURCES ) $$ {dest}/$(js_runtime_dir ) && \
361
+ cp -a $(JS_SAMPLE_SOURCES ) $$ {dest}/$(js_sample_dir ) && \
362
+ cp -a $(JS_SOURCES ) $$ {dest}/$(js_runtime_dir ) && \
366
363
(cd $$ {dest} && \
367
364
echo " README" >> MANIFEST && \
368
- ls $(jsx_runtime_dir ) /* .jsx >> MANIFEST && \
369
- ls $(jsx_sample_dir ) /* .jsx >> MANIFEST) && \
365
+ ls $(js_runtime_dir ) /* .js >> MANIFEST && \
366
+ ls $(js_sample_dir ) /* .js >> MANIFEST) && \
370
367
(cd dist && tar zcf $$ {destname}.tgz $$ {destname}) && \
371
368
rm -rf $$ {dest}
372
369
@@ -446,13 +443,13 @@ check_java_%: $(STEMMING_DATA_ABS)/%
446
443
fi
447
444
@rm tmp.txt
448
445
449
- check_jsx : $(libstemmer_algorithms:%=check_jsx_ % )
446
+ check_js : $(libstemmer_algorithms:%=check_js_ % )
450
447
451
448
# Keep one in $(THIN_FACTOR) entries from gzipped vocabularies.
452
449
THIN_FACTOR ?= 3
453
450
454
451
# Command to thin out the testdata - the full arabic test data causes
455
- # jsx_stemwords to run out of memory. Also use for Python tests, which
452
+ # stemwords.js to run out of memory. Also use for Python tests, which
456
453
# take a long time (unless you use pypy).
457
454
THIN_TEST_DATA := awk '(FNR % $(THIN_FACTOR ) == 0){print}'
458
455
@@ -474,14 +471,16 @@ check_rust_%: $(STEMMING_DATA_ABS)/%
474
471
fi
475
472
@rm tmp.txt
476
473
477
- check_jsx_% : $(STEMMING_DATA ) /% jsx_stemwords
478
- @echo " Checking output of ` echo $< | sed ' s!.*/!!' ` stemmer for JSX"
474
+ export NODE_PATH = $(js_output_dir ) :$(js_runtime_src_dir )
475
+
476
+ check_js_% : $(STEMMING_DATA ) /%
477
+ @echo " Checking output of ` echo $< | sed ' s!.*/!!' ` stemmer for JS"
479
478
@if test -f ' $</voc.txt.gz' ; then \
480
479
gzip -dc ' $</voc.txt.gz' | $(THIN_TEST_DATA ) > tmp.in; \
481
- ./jsx_stemwords -c utf8 -l ` echo $< | sed ' s!.*/!!' ` -i tmp.in -o tmp.txt; \
480
+ $( NODE ) stemwords.js -c utf8 -l ` echo $< | sed ' s!.*/!!' ` -i tmp.in -o tmp.txt; \
482
481
rm tmp.in; \
483
482
else \
484
- ./jsx_stemwords -c utf8 -l ` echo $< | sed ' s!.*/!!' ` -i $< /voc.txt -o tmp.txt; \
483
+ $( NODE ) stemwords.js -c utf8 -l ` echo $< | sed ' s!.*/!!' ` -i $< /voc.txt -o tmp.txt; \
485
484
fi
486
485
@if test -f ' $</output.txt.gz' ; then \
487
486
gzip -dc ' $</output.txt.gz' | $(THIN_TEST_DATA ) | diff -u - tmp.txt; \
0 commit comments