This is an automated email from the ASF dual-hosted git repository. sergeykamov pushed a commit to branch NLPCRAFT-491 in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
commit 00d099dae98d8e14537d3c8eda463b686c1b529d Merge: 41e4569d ab461767 Author: Sergey Kamov <skhdlem...@gmail.com> AuthorDate: Thu Jul 7 10:40:28 2022 +0300 Merge branch 'NLPCRAFT-504' into NLPCRAFT-491 # Conflicts: # nlpcraft-stanford/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/stanford/NCStanfordNLPEntityParser.scala .../entity/parser/NCFrSemanticEntityParser.scala | 2 +- .../entity/parser/NCRuSemanticEntityParser.scala | 2 +- .../stanford/NCStanfordNLPEntityParser.scala | 6 ++---- .../parser/semantic/NCSemanticEntityParser.scala | 24 ++++++++++++---------- 4 files changed, 17 insertions(+), 17 deletions(-) diff --cc nlpcraft-stanford/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/stanford/NCStanfordNLPEntityParser.scala index 5a9dda13,d17e3c04..0fe28ffb --- a/nlpcraft-stanford/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/stanford/NCStanfordNLPEntityParser.scala +++ b/nlpcraft-stanford/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/stanford/NCStanfordNLPEntityParser.scala @@@ -21,8 -21,7 +21,6 @@@ import edu.stanford.nlp.ling.CoreAnnota import edu.stanford.nlp.pipeline.* import org.apache.nlpcraft.* - import java.util - import java.util.stream.Collectors -import java.util.Objects import scala.collection.mutable import scala.jdk.CollectionConverters.* @@@ -32,11 -31,9 +30,11 @@@ * @param supported */ class NCStanfordNLPEntityParser(stanford: StanfordCoreNLP, supported: Set[String]) extends NCEntityParser: - require(stanford != null, "Stanford instance cannot be null.") - require(supported != null, "Supported elements set cannot be null.") + require(stanford != null, "Stanford instance cannot be null."); + require(supported != null && supported.nonEmpty, "Supported elements set cannot be null or empty."); + private val supportedLc = supported.map(_.toLowerCase) + override def parse(req: NCRequest, cfg: NCModelConfig, toks: List[NCToken]): List[NCEntity] = val doc = new CoreDocument(req.getText) stanford.annotate(doc)