You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nlpcraft.apache.org by se...@apache.org on 2021/03/12 07:57:53 UTC

[incubator-nlpcraft] branch master updated: Minor refactoring.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new db066f4  Minor refactoring.
db066f4 is described below

commit db066f4cf566268be769104d8c5c324fdb3a837f
Author: Sergey Kamov <sk...@gmail.com>
AuthorDate: Fri Mar 12 10:57:37 2021 +0300

    Minor refactoring.
---
 .../org/apache/nlpcraft/common/nlp/NCNlpSentenceToken.scala      | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentenceToken.scala b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentenceToken.scala
index 6017a4b..693192e 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentenceToken.scala
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/common/nlp/NCNlpSentenceToken.scala
@@ -62,13 +62,6 @@ case class NCNlpSentenceToken(
     def getNotes(noteType: String): Iterable[NCNlpSentenceNote] = notes.filter(_.noteType == noteType)
 
     /**
-      *
-      * @param noteType
-      * @return
-      */
-    def exists(noteType: String): Boolean = notes.exists(_.noteType == noteType)
-
-    /**
       * Clones note.
       * Shallow copy.
       */
@@ -170,7 +163,7 @@ case class NCNlpSentenceToken(
       *
       * @param types Note type(s) to check.
       */
-    def isTypeOf(types: String*): Boolean = types.exists(exists)
+    def isTypeOf(types: String*): Boolean = types.exists(t ⇒ notes.exists(_.noteType == t))
 
     /**
       * Adds element.