@@ -12,10 +12,10 @@ python_output_dir = python_out
1212python_runtime_dir = snowballstemmer
1313python_sample_dir = sample
1414
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
1919
2020cargo ?= cargo
2121cargoflags ?=
@@ -46,7 +46,7 @@ COMPILER_SOURCES = compiler/space.c \
4646 compiler/generator.c \
4747 compiler/driver.c \
4848 compiler/generator_java.c \
49- compiler/generator_jsx .c \
49+ compiler/generator_js .c \
5050 compiler/generator_python.c \
5151 compiler/generator_rust.c
5252
@@ -65,12 +65,12 @@ JAVARUNTIME_SOURCES = java/org/tartarus/snowball/Among.java \
6565 java/org/tartarus/snowball/SnowballStemmer.java \
6666 java/org/tartarus/snowball/TestApp.java
6767
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
7171
72- JSX_SAMPLE_SOURCES = jsx /testapp.jsx \
73- jsx /stemwords.jsx
72+ JS_SAMPLE_SOURCES = js /testapp.js \
73+ js /stemwords.js
7474
7575PYTHON_RUNTIME_SOURCES = python/snowballstemmer/basestemmer.py \
7676 python/snowballstemmer/among.py
@@ -88,7 +88,7 @@ LIBSTEMMER_EXTRA = libstemmer/modules.txt libstemmer/modules_utf8.txt libstemmer
8888
8989STEMWORDS_SOURCES = examples/stemwords.c
9090
91- JSX_STEMWORDS_SOURCE = jsx /stemwords.jsx
91+ JS_STEMWORDS_SOURCE = js /stemwords.js
9292
9393PYTHON_STEMWORDS_SOURCE = python/stemwords.py
9494
@@ -106,7 +106,7 @@ C_OTHER_HEADERS = $(other_algorithms:%=$(c_src_dir)/stem_UTF_8_%.h)
106106JAVA_SOURCES = $(libstemmer_algorithms:%=$(java_src_dir ) /%Stemmer.java )
107107PYTHON_SOURCES = $(libstemmer_algorithms:%=$(python_output_dir ) /%_stemmer.py ) \
108108 $(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 )
110110RUST_SOURCES = $(libstemmer_algorithms:%=$(rust_src_dir ) /%_stemmer.rs )
111111
112112COMPILER_OBJECTS=$(COMPILER_SOURCES:.c =.o)
@@ -135,14 +135,14 @@ clean:
135135 $(C_OTHER_SOURCES) $(C_OTHER_HEADERS) $(C_OTHER_OBJECTS) \
136136 $(JAVA_SOURCES) $(JAVA_CLASSES) $(JAVA_RUNTIME_CLASSES) \
137137 $(PYTHON_SOURCES) \
138- $(JSX_SOURCES) jsx_stemwords \
138+ $(JS_SOURCES) \
139139 $(RUST_SOURCES) \
140140 libstemmer/mkinc.mak libstemmer/mkinc_utf8.mak \
141141 libstemmer/libstemmer.c libstemmer/libstemmer_utf8.c
142142 rm -rf dist
143143 rmdir $(c_src_dir) || true
144144 rmdir $(python_output_dir) || true
145- rmdir $(jsx_output_dir ) || true
145+ rmdir $(js_output_dir ) || true
146146
147147snowball : $(COMPILER_OBJECTS )
148148 $(CC ) -o $@ $^
@@ -169,9 +169,6 @@ libstemmer.o: libstemmer/libstemmer.o $(RUNTIME_OBJECTS) $(C_LIB_OBJECTS)
169169stemwords : $(STEMWORDS_OBJECTS ) libstemmer.o
170170 $(CC ) -o $@ $^
171171
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-
175172algorithms/% /stem_Unicode.sbl : algorithms/% /stem_ISO_8859_1.sbl
176173 cp $^ $@
177174
@@ -231,19 +228,19 @@ $(rust_src_dir)/%_stemmer.rs: algorithms/%/stem_Unicode.sbl snowball
231228 echo " ./snowball $< -rust -o $$ {o}" ; \
232229 ./snowball $< -rust -o $$ {o}
233230
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 )
236233 @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
240237
241238splint : snowball.splint
242239snowball.splint : $(COMPILER_SOURCES )
243240 splint $^ > $@ -weak
244241
245242# 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
247244
248245# Make a distribution of all the sources involved in snowball
249246dist_snowball : $(COMPILER_SOURCES ) $(COMPILER_HEADERS ) \
@@ -351,22 +348,22 @@ dist_libstemmer_python: $(PYTHON_SOURCES)
351348 (cd $$ {dest} && $( python) setup.py sdist && cp dist/* .tar.gz ..) && \
352349 rm -rf $$ {dest}
353350
354- dist_libstemmer_jsx : $(JSX_SOURCES )
355- destname=jsxstemmer ; \
351+ dist_libstemmer_js : $(JS_SOURCES )
352+ destname=jsstemmer ; \
356353 dest=dist/$$ {destname}; \
357354 rm -rf $$ {dest} && \
358355 rm -f $$ {dest}.tgz && \
359356 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 ) && \
366363 (cd $$ {dest} && \
367364 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) && \
370367 (cd dist && tar zcf $$ {destname}.tgz $$ {destname}) && \
371368 rm -rf $$ {dest}
372369
@@ -446,13 +443,13 @@ check_java_%: $(STEMMING_DATA_ABS)/%
446443 fi
447444 @rm tmp.txt
448445
449- check_jsx : $(libstemmer_algorithms:%=check_jsx_ % )
446+ check_js : $(libstemmer_algorithms:%=check_js_ % )
450447
451448# Keep one in $(THIN_FACTOR) entries from gzipped vocabularies.
452449THIN_FACTOR ?= 3
453450
454451# 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
456453# take a long time (unless you use pypy).
457454THIN_TEST_DATA := awk '(FNR % $(THIN_FACTOR ) == 0){print}'
458455
@@ -474,14 +471,16 @@ check_rust_%: $(STEMMING_DATA_ABS)/%
474471 fi
475472 @rm tmp.txt
476473
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"
479478 @if test -f ' $</voc.txt.gz' ; then \
480479 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; \
482481 rm tmp.in; \
483482 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; \
485484 fi
486485 @if test -f ' $</output.txt.gz' ; then \
487486 gzip -dc ' $</output.txt.gz' | $(THIN_TEST_DATA ) | diff -u - tmp.txt; \
0 commit comments