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

Commit

Permalink
more stufffffff
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Nov 26, 2019
1 parent 47bc120 commit bb069b2
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/main/java/com/andromeda/araserver/util/SortWords.kt
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,8 @@ class SortWords(keyWord: KeyWord, mainVal: String) {
return toReturn

}
fun getTopicsPhrase(parse: Parser): String {
var toReturn = "qwertyuio"
fun getTopicsPhrase(parse: Parser): ArrayList<WordGraph> {
var toReturn = ArrayList<WordGraph>()

var graph = key.getKeyWords(mainText,parse)?.get(0)
graph?.show()
Expand All @@ -134,7 +134,7 @@ class SortWords(keyWord: KeyWord, mainVal: String) {
else -> {
if (graph != null) {
val toTest = sortForTopics(graph)
if(toTest != "")toReturn = toTest
toReturn.addAll(toTest)
}
working = false
}
Expand All @@ -149,18 +149,18 @@ class SortWords(keyWord: KeyWord, mainVal: String) {

}

fun sortForTopics(graph: Parse): String {
fun sortForTopics(graph: Parse): ArrayList<WordGraph> {
println("start")
var toReturn = ""
var toReturn = ArrayList<WordGraph>()
for (i in graph.children!!) {
print(i.coveredText+ " " + i.type)
if (i.type == "NP" && i.parent.type == "PP" ) {
toReturn = i.coveredText
toReturn.add(WordGraph(i.coveredText, i.type))
}
if (i.childCount > 0){ val toTest = sortForTopics(i)
if(toTest != "")toReturn = toTest
if (i.childCount > 0) toReturn.addAll(sortForNoun(i))
}
}
return toReturn
}
}


}

0 comments on commit bb069b2

Please sign in to comment.