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

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


The following commit(s) were added to refs/heads/NLPCRAFT-483 by this push:
     new a235f40  RU adapters added (example)
a235f40 is described below

commit a235f4037ae5c1852408bbe0d121c5082a0a4f0b
Author: Sergey Kamov <[email protected]>
AuthorDate: Fri Feb 25 23:31:22 2022 +0300

    RU adapters added (example)
---
 .../nlp/token/enricher/NCRuStopWordsTokenEnricher.scala            | 7 +++----
 .../examples/lightswitch/nlp/token/parser/NCRuTokenParser.scala    | 2 +-
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git 
a/nlpcraft-examples/lightswitch-ru/src/main/java/org/apache/nlpcraft/examples/lightswitch/nlp/token/enricher/NCRuStopWordsTokenEnricher.scala
 
b/nlpcraft-examples/lightswitch-ru/src/main/java/org/apache/nlpcraft/examples/lightswitch/nlp/token/enricher/NCRuStopWordsTokenEnricher.scala
index e21c3dc..082e63d 100644
--- 
a/nlpcraft-examples/lightswitch-ru/src/main/java/org/apache/nlpcraft/examples/lightswitch/nlp/token/enricher/NCRuStopWordsTokenEnricher.scala
+++ 
b/nlpcraft-examples/lightswitch-ru/src/main/java/org/apache/nlpcraft/examples/lightswitch/nlp/token/enricher/NCRuStopWordsTokenEnricher.scala
@@ -37,9 +37,8 @@ class NCRuStopWordsTokenEnricher extends NCTokenEnricher:
             t.put(
                 "stopword",
                 lemma.length == 1 && !Character.isLetter(lemma.head) ||
+                stops.contains(lemma.toLowerCase) ||
                 pos.startsWith("PARTICLE") ||
                 pos.startsWith("INTERJECTION") ||
-                pos.startsWith("PREP") ||
-                stops.contains(t.getLemma) ||
-                stops.contains(t.getText.toLowerCase)
-            )
+                pos.startsWith("PREP")
+            )
\ No newline at end of file
diff --git 
a/nlpcraft-examples/lightswitch-ru/src/main/java/org/apache/nlpcraft/examples/lightswitch/nlp/token/parser/NCRuTokenParser.scala
 
b/nlpcraft-examples/lightswitch-ru/src/main/java/org/apache/nlpcraft/examples/lightswitch/nlp/token/parser/NCRuTokenParser.scala
index d0136b9..feca7fc 100644
--- 
a/nlpcraft-examples/lightswitch-ru/src/main/java/org/apache/nlpcraft/examples/lightswitch/nlp/token/parser/NCRuTokenParser.scala
+++ 
b/nlpcraft-examples/lightswitch-ru/src/main/java/org/apache/nlpcraft/examples/lightswitch/nlp/token/parser/NCRuTokenParser.scala
@@ -70,7 +70,7 @@ class NCRuTokenParser extends NCTokenParser:
                     override val getIndex: Int = idx
                     override val getStartCharIndex: Int = span.start
                     override val getEndCharIndex: Int = span.end
-                    override val getLemma: String = lemma.toLowerCase
+                    override val getLemma: String = lemma
                     override val getPos: String = pos
             tok
         }.asJava
\ No newline at end of file

Reply via email to