Changeset 33339

Show
Ignore:
Timestamp:
20.07.2019 23:43:53 (5 weeks ago)
Author:
ak19
Message:

Updated README.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs3-extensions/maori-lang-detection/README.txt

    r33335 r33339  
     1------------------ 
     2BASIC README 
     3------------------ 
     40. The code and its necessary helper files and libraries, and this README, live at: 
     5    http://trac.greenstone.org/browser/gs3-extensions/maori-lang-detection 
     6 
     7You can checkout from svn with: 
     8    svn co http://svn.greenstone.org/gs3-extensions/maori-lang-detection 
     9 
     10- It contains the OpenNLP that was current at the time of the commit, but you can also get it from its original site http://opennlp.apache.org/download.html 
     11- The LanguageDetectionModel to be used by OpenNLP is also included (again, current at the time of commit), but you can get it from http://opennlp.apache.org/models.html (direct link: https://www.apache.org/dyn/closer.cgi/opennlp/models/langdetect/1.8.3/langdetect-183.bin) 
     12 
     131. Once you've svn checked it out, create a folder called "models" and put the langdetect-183.bin file into it. 
     14(This is just a zip file, but has to remain with the .bin extension in order for OpenNLP to use it. If you ever wish to see its contents, you can rename to .zip and use the Archive Manager or other Zip tool to inspect the contents.) 
     15 
     162. Next extract the apache-opennlp-1.9.1-bin.tar.gz. 
     17This will create a folder called apache-opennlp-1.9.1. Move the "models" folder you created in step 1 into this folder. 
     18 
     193. Before you can compile or run the MaoriTextDetector program, you always have to prepare a terminal by setting up the environment for OpenNLP as follows: 
     20   cd /type/here/path/to/your/extracted/apache-opennlp-1.9.1 
     21   export OPENNLP_HOME=`pwd` 
     22 
     23 
     244. If you want to recompile, go up into the checked out maori-lang-detection folder's "src" subfolder. To compile, make sure you have the JDK7+ bin folder on your PATH environment variable. 
     25Still in the SAME terminal as where you set up the OPENNLP_HOME environment in step 3, you can now run: 
     26      maori-lang-detection/src$ javac -cp ".:$OPENNLP_HOME/lib/opennlp-tools-1.9.1.jar" MaoriTextDetector.java 
     27 
     285. To run the MaoriTextDetector program, you will need the JDK or JRE 7+ bin folder on your PATH and still in the SAME terminal as where you set up the OPENNLP_HOME environment in step 3, 
     29type one of the following: 
     30   maori-lang-detection/src$ java -cp ".:$OPENNLP_HOME/lib/*" MaoriTextDetector --help 
     31   (prints the usage, including other options)                   
     32  
     33   maori-lang-detection/src$ java -cp ".:$OPENNLP_HOME/lib/*" MaoriTextDetector --file <full/path/to/textfile> 
     34  
     35   maori-lang-detection/src$ java -cp ".:$OPENNLP_HOME/lib/*" MaoriTextDetector - 
     36       which expects text to stream in from standard input. 
     37       If entering text manually, then remember to press Ctrl-D to indicate the usual end of StdIn. 
     38 
     39 
     40 
     41 
     42For reading materials, see the OLD README section below. 
     43 
     44------------------------- 
     45     OLD README 
     46------------------------- 
     47 
     48 
    149http://opennlp.apache.org/news/model-langdetect-183.html 
    250Language Detector Model for Apache OpenNLP released