The new version of stanford-segmenter-2016-10-31 don't need the path of slf4j
The new version of stanford-segmenter-2016-10-31 don't need the path of slf4j

Now the stanford_segmenter.py is not working using the new release of
stanford-segmenter-2016-10-31.

Since the exception is threw when executing the java cmd, I tested the
following cmd and finally catch the bug.

1. work (the existing version of segment.sh from
stanford-segmenter-2016-10-31)

  java -mx2g -cp ./*: edu.stanford.nlp.ie.crf.CRFClassifier
-sighanCorporaDict ./data -textFile input.txt -inputEncoding UTF-8
-sighanPostProcessing true -keepAllWhitespaces false -loadClassifier
./data/ctb.gz -serDictionary ./data/dict-chris6.ser.gz

2. work (replace the . to absolute path from 1)

  java -mx2g -cp ./*: edu.stanford.nlp.ie.crf.CRFClassifier
-sighanCorporaDict
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data -textFile
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/input.txt -inputEncoding UTF-8 -sighanPostProcessing true
-keepAllWhitespaces false -loadClassifier
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/ctb.gz -serDictionary
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/dict-chris6.ser.gz

3. not work (replace ./* to specific files from 2)

  /usr/bin/java -mx2g -cp
//Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-1
0-31/stanford-segmenter-3.7.0.jar://Users/xu2333/Documents/4Paradigm/sta
nfordNLP/stanford-segmenter-2016-10-31/slf4j-1.7.25/slf4j-api-1.7.25.jar
: edu.stanford.nlp.ie.crf.CRFClassifier -sighanCorporaDict
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data -textFile
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/input.txt -inputEncoding UTF-8 -sighanPostProcessing true
-keepAllWhitespaces false -loadClassifier
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/ctb.gz -serDictionary
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/dict-chris6.ser.gz

4. not work (the existing version of stanford-segmenter.py)

  /usr/bin/java -mx2g -cp
//Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-1
0-31/stanford-segmenter-3.7.0.jar://Users/xu2333/Documents/4Paradigm/sta
nfordNLP/stanford-segmenter-2016-10-31/slf4j-1.7.25/slf4j-api-1.7.25.jar
 edu.stanford.nlp.ie.crf.CRFClassifier -loadClassifier
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/pku.gz -keepAllWhitespaces false -textFile input.txt
-serDictionary
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/dict-chris6.ser.gz -sighanCorporaDict
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/./data/ -sighanPostProcessing true -inputEncoding UTF-8

5. work (replace specific files to ./* from 4)

  /usr/bin/java -mx2g -cp ./*: edu.stanford.nlp.ie.crf.CRFClassifier
-loadClassifier
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/pku.gz -keepAllWhitespaces false -textFile input.txt
-serDictionary
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/dict-chris6.ser.gz -sighanCorporaDict
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/./data/ -sighanPostProcessing true -inputEncoding UTF-8

6. work (replace specific file names to * from 4) -> adapt as the new
version of stanford-segmenter.py

  /usr/bin/java -mx2g -cp
//Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-1
0-31/*: edu.stanford.nlp.ie.crf.CRFClassifier -loadClassifier
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/pku.gz -keepAllWhitespaces false -textFile input.txt
-serDictionary
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/dict-chris6.ser.gz -sighanCorporaDict
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/./data/ -sighanPostProcessing true -inputEncoding UTF-8

7. not work (replace absolute path to relative path from 4)

  /usr/bin/java -mx2g -cp
./stanford-segmenter-3.7.0.jar:./slf4j-1.7.25/slf4j-api-1.7.25.jar
edu.stanford.nlp.ie.crf.CRFClassifier -loadClassifier
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/pku.gz -keepAllWhitespaces false -textFile input.txt
-serDictionary
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/dict-chris6.ser.gz -sighanCorporaDict
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/./data/ -sighanPostProcessing true -inputEncoding UTF-8

8. work (remove slf4j from 7)

  /usr/bin/java -mx2g -cp ./stanford-segmenter-3.7.0.jar:
edu.stanford.nlp.ie.crf.CRFClassifier -loadClassifier
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/pku.gz -keepAllWhitespaces false -textFile input.txt
-serDictionary
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/dict-chris6.ser.gz -sighanCorporaDict
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/./data/ -sighanPostProcessing true -inputEncoding UTF-8

9. not work (remove segmenter from 7)

  /usr/bin/java -mx2g -cp ./slf4j-1.7.25/slf4j-api-1.7.25.jar:
edu.stanford.nlp.ie.crf.CRFClassifier -loadClassifier
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/pku.gz -keepAllWhitespaces false -textFile input.txt
-serDictionary
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/data/dict-chris6.ser.gz -sighanCorporaDict
/Users/xu2333/Documents/4Paradigm/stanfordNLP/stanford-segmenter-2016-10
-31/./data/ -sighanPostProcessing true -inputEncoding UTF-8

Now the reason is quite clear, the new version of
stanford-segmenter-2016-10-31 don't need the path of slf4j.
This modification could fix the bug of both Chinese segmenter and
Arabic segmenter.

nltk/nltk,nltk/nltk,nltk/nltk