This is an automated email from the ASF dual-hosted git repository.

sergeykamov pushed a commit to branch NLPCRAFT-41
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git


The following commit(s) were added to refs/heads/NLPCRAFT-41 by this push:
     new 9c8f389  WIP.
9c8f389 is described below

commit 9c8f389493c2fadf312780dc43c1a99e96e2c283
Author: Sergey Kamov <[email protected]>
AuthorDate: Sat Apr 25 12:45:39 2020 +0300

    WIP.
---
 .../nlpcraft/model/tools/synonyms/NCSynonymsGenerator.scala       | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git 
a/src/main/scala/org/apache/nlpcraft/model/tools/synonyms/NCSynonymsGenerator.scala
 
b/src/main/scala/org/apache/nlpcraft/model/tools/synonyms/NCSynonymsGenerator.scala
index 4d37250..484ac7f 100644
--- 
a/src/main/scala/org/apache/nlpcraft/model/tools/synonyms/NCSynonymsGenerator.scala
+++ 
b/src/main/scala/org/apache/nlpcraft/model/tools/synonyms/NCSynonymsGenerator.scala
@@ -42,9 +42,7 @@ case class NCSynonymsGenerator(url: String, modelPath: 
String, minFactor: Double
     case class Suggestion(word: String, bert: String, normalized: String, 
ftext: String, score: String) {
         override def toString: String = s"$word [bert=$bert, ftext=$ftext, 
normalized=$normalized, score=$score]"
     }
-
     case class Request(sentence: String, simple: Boolean)
-
     case class Response(data: java.util.ArrayList[Suggestion])
 
     private val GSON = new Gson
@@ -139,7 +137,9 @@ case class NCSynonymsGenerator(url: String, modelPath: 
String, minFactor: Double
                             if (idxs.nonEmpty)
                                 stemsSyns.map(_._2).flatMap(syn ⇒ {
                                     val wordsTxt =
-                                        exWords.zipWithIndex.map { case (word, 
idx) ⇒ if (idxs.contains(idx)) syn else word.word }
+                                        exWords.zipWithIndex.map {
+                                            case (word, idx) ⇒ if 
(idxs.contains(idx)) syn else word.word
+                                        }
 
                                     idxs.flatMap(idx ⇒ {
                                         val sen =
@@ -150,7 +150,7 @@ case class NCSynonymsGenerator(url: String, modelPath: 
String, minFactor: Double
                                         cache.get(sen) match {
                                             case Some(res) ⇒ res
                                             case None ⇒
-                                                val res: Seq[Suggestion] = 
ask(client, sen).filter(_.score.toDouble >= minFactor)
+                                                val res = ask(client, 
sen).filter(_.score.toDouble >= minFactor)
 
                                                 cache += sen → res
 

Reply via email to