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

Commit

Permalink
working on an array
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Nov 16, 2019
1 parent ce56785 commit 132c395
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions src/main/java/com/andromeda/araserver/util/SortWords.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SortWords(keyWord: KeyWord, mainVal: String) {
}
else -> {
if (graph != null) {
sortNouns(graph)
sortForGraph(graph)
}
working = false
}
Expand All @@ -36,11 +36,14 @@ class SortWords(keyWord: KeyWord, mainVal: String) {


}
private fun sortNouns(graph: Parse){
private fun sortForGraph(graph: Parse): ArrayList<WordGraph> {
val toReturn = ArrayList<WordGraph>()
for (i in graph.children!!) {
toReturn.add(WordGraph(i.coveredText, i.label))
println(i.type)
if (i.childCount > 0) sortNouns(i)
if (i.childCount > 0) toReturn.addAll(sortForGraph(i))
}
return toReturn

}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/andromeda/araserver/util/WordGraph.kt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package com.andromeda.araserver.util

data class WordGraph(val word:String, val type:Int)
data class WordGraph(val word:String, val type:String)

0 comments on commit 132c395

Please sign in to comment.