Skip to content
This repository has been archived by the owner on Oct 3, 2020. It is now read-only.

Commit

Permalink
experiments
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Nov 19, 2019
1 parent 19b3934 commit ce06921
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 12 deletions.
11 changes: 8 additions & 3 deletions src/main/java/com/andromeda/araserver/Run.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.net.MalformedURLException;
import java.sql.SQLException;
import java.util.Arrays;
import java.util.Objects;


public class Run extends NanoHTTPD {
Expand Down Expand Up @@ -50,13 +51,17 @@ public void run() {
InputStream is = classloader.getResourceAsStream("parse.bin");
assert is != null;
keyWord = new KeyWord(is);
System.out.println("test 1 done");
Objects.requireNonNull(keyWord.getKeyWords("What is the weather in south oregon ?"))[0].show();


System.out.println("done");
keyWord.getKeyWords("What is the weather in south oregon ?")[0].show();
System.out.println("go");
}
}).start();
;
keyWord.getKeyWords("What is the weather in south atlanta ?")[0].show();
System.out.println("done");
}

//(TOP (SBAR (WHNP (WP what)) (S (VP (VBZ is) (NP (NP (DT the) (NN value)) (PP (IN of) (NP (NN pi))))))))


Expand Down
19 changes: 10 additions & 9 deletions src/main/java/com/andromeda/araserver/util/KeyWord.kt
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ import java.io.InputStream

class KeyWord(parseIS:InputStream) {
val parse = parseIS
var parser: Parser? = null
var m =ParserModel(parse)
var parser = ParserFactory.create(m)

fun getKeyWords(mainVal:String): Array<out Parse>? {
val m =ParserModel(parse)
parser = ParserFactory.create(m)

return ParserTool.parseLine(mainVal, parser, 1)
}
//companion object KeyWord{
// fun start(){
//println("running")
//val m =ParserModel(parse)
//parser = ParserFactory.create(m)
//}
init {
m =ParserModel(parse)
parser = ParserFactory.create(m)
}
companion object{

}
}


Expand Down

0 comments on commit ce06921

Please sign in to comment.