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

Commit

Permalink
working on the new search
Browse files Browse the repository at this point in the history
  • Loading branch information
fulton committed Nov 23, 2019
1 parent bb18819 commit caac13d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/main/java/com/andromeda/araserver/util/MsSql.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class MsSql {
Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
var connection: Connection? = null
val phrases = SortWords(keyWord = keyWord, mainVal = phrase).getTopics(parse = parse)
println(phrases.size)
var link = "test"
println(password)
connection = DriverManager.getConnection(url)
Expand All @@ -30,10 +31,7 @@ class MsSql {
{
val dbLink = resultSet.getString("link")
val dbWord = resultSet.getString("hotWord")
println(dbWord)
for (i in phrases){
println("db word is $dbWord")
println("word is "+i.word)
if (i.word.startsWith(dbWord.replace(" ", ""))){
print("is true")
link = dbLink
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/andromeda/araserver/util/SortWords.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@ class SortWords(keyWord: KeyWord, mainVal: String) {

var graph = key.getKeyWords(mainText,parse)?.get(0)


var working = true
if (graph != null) {
graph.show()

while (working) {
when {
Expand Down Expand Up @@ -43,6 +45,7 @@ class SortWords(keyWord: KeyWord, mainVal: String) {
private fun sortForNoun(graph: Parse): ArrayList<WordGraph> {
val toReturn = ArrayList<WordGraph>()
for (i in graph.children!!) {
print(i.coveredText+ " " + i.type)
if (i.type == "NN" || i.type == "JJ") {
toReturn.add(WordGraph(i.coveredText, i.type))
}
Expand Down

0 comments on commit caac13d

Please sign in to comment.