[refactor] do some works
- move gitignore in individual directories. - change some directory layout. - refactor NlpCodec but not finished.
This commit is contained in:
42
NlpParser/.gitignore
vendored
Normal file
42
NlpParser/.gitignore
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
# ===== Custom =====
|
||||
# Only preserve testbench in assets.
|
||||
assets/*
|
||||
!assets/testbench.txt
|
||||
|
||||
# ===== ANTLR Output =====
|
||||
*.interp
|
||||
*.tokens
|
||||
|
||||
Nlp*.java
|
||||
|
||||
# ===== Eclipse Java =====
|
||||
# Eclipse projects
|
||||
.classpath
|
||||
.project
|
||||
.settings/
|
||||
.metadata
|
||||
|
||||
# Compiled class file
|
||||
*.class
|
||||
|
||||
# Log file
|
||||
*.log
|
||||
|
||||
# BlueJ files
|
||||
*.ctxt
|
||||
|
||||
# Mobile Tools for Java (J2ME)
|
||||
.mtj.tmp/
|
||||
|
||||
# Package Files #
|
||||
*.jar
|
||||
*.war
|
||||
*.nar
|
||||
*.ear
|
||||
*.zip
|
||||
*.tar.gz
|
||||
*.rar
|
||||
|
||||
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||
hs_err_pid*
|
||||
replay_pid*
|
@ -21,7 +21,7 @@ import java.io.OutputStreamWriter;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.charset.Charset;
|
||||
|
||||
public class NlpRunner {
|
||||
public class MainRunner {
|
||||
public static class NlpJsonConverter extends NlpBaseListener {
|
||||
public NlpJsonConverter() {
|
||||
mGsonInstance = new GsonBuilder().setPrettyPrinting().disableHtmlEscaping().create();
|
||||
@ -148,7 +148,7 @@ public class NlpRunner {
|
||||
}
|
||||
|
||||
private static void printHelp() {
|
||||
System.out.println("NlpRunner <src> <dest>");
|
||||
System.out.println("NlpParser <src> <dest>");
|
||||
System.out.println();
|
||||
System.out.println("<src> - the decoded nlp text file.");
|
||||
System.out.println("<dest> - the output json file.");
|
@ -8,9 +8,9 @@ Requirements:
|
||||
Useful commands:
|
||||
|
||||
* `antlr4 Nlp.g4`: Analyze Antlr format file.
|
||||
* `javac Nlp*.java`: Compile executable application.
|
||||
* `javac *.java`: Compile executable application.
|
||||
* Do testbench
|
||||
- `grun Nlp document -tree < testbench.txt`
|
||||
- `grun Nlp document -gui < testbench.txt`
|
||||
- `java NlpRunner testbench.txt result.json`
|
||||
- `java MainRunner testbench.txt out/result.json`
|
||||
|
||||
|
Reference in New Issue
Block a user