This is an automated email from the ASF dual-hosted git repository.
sergeykamov pushed a commit to branch NLPCRAFT-472
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-472 by this push:
new 67e9d08 WIP.
67e9d08 is described below
commit 67e9d089e61756aeefcc86d8fcab2c53786f4d31
Author: Sergey Kamov <[email protected]>
AuthorDate: Thu Dec 30 00:07:36 2021 +0300
WIP.
---
.../nlp/entity/parser/semantic/NCSemanticElementValue.java | 12 +++++++++++-
.../nlp/entity/parser/semantic/NCSemanticEntityParser.java | 12 ++++++------
.../parser/semantic/impl/NCSemanticEntityParserImpl.scala | 4 ++--
3 files changed, 19 insertions(+), 9 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticElementValue.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticElementValue.java
index a7106c8..1814255 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticElementValue.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticElementValue.java
@@ -17,6 +17,7 @@
package org.apache.nlpcraft.nlp.entity.parser.semantic;
+import java.util.Collections;
import java.util.List;
/**
@@ -24,8 +25,17 @@ import java.util.List;
*/
public interface NCSemanticElementValue {
/**
+ * Gets value name.
+ *
+ * @return Value name.
+ */
+ String getName();
+
+ /**
*
* @return
*/
- List<String> getSynonyms();
+ default List<String> getSynonyms() {
+ return Collections.emptyList();
+ }
}
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParser.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParser.java
index 717b1bd..22bdea3 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParser.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/NCSemanticEntityParser.java
@@ -55,19 +55,19 @@ public class NCSemanticEntityParser implements
NCEntityParser {
/**
*
* @param stemmer
- * @param elemsFile
+ * @param mdlFile
*/
- public NCSemanticEntityParser(NCSemanticTextStemmer stemmer, File
elemsFile) {
- impl = NCSemanticEntityParserImpl.apply(stemmer, elemsFile);
+ public NCSemanticEntityParser(NCSemanticTextStemmer stemmer, File mdlFile)
{
+ impl = NCSemanticEntityParserImpl.apply(stemmer, mdlFile);
}
/**
*
* @param stemmer
- * @param elemsSrc
+ * @param mdlSrc
*/
- public NCSemanticEntityParser(NCSemanticTextStemmer stemmer, String
elemsSrc) {
- impl = NCSemanticEntityParserImpl.apply(stemmer, elemsSrc);
+ public NCSemanticEntityParser(NCSemanticTextStemmer stemmer, String
mdlSrc) {
+ impl = NCSemanticEntityParserImpl.apply(stemmer, mdlSrc);
}
@Override
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/impl/NCSemanticEntityParserImpl.scala
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/impl/NCSemanticEntityParserImpl.scala
index e33c3b1..cbed8d8 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/impl/NCSemanticEntityParserImpl.scala
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/nlp/entity/parser/semantic/impl/NCSemanticEntityParserImpl.scala
@@ -33,9 +33,9 @@ import scala.jdk.CollectionConverters.*
object NCSemanticEntityParserImpl:
def apply(stemmer: NCSemanticTextStemmer, macros: Jmap[String, String],
elems: JList[NCSemanticElement]): NCSemanticEntityParserImpl =
new NCSemanticEntityParserImpl(stemmer, macros.asScala.toMap,
elems.asScala.toSeq)
- def apply(stemmer: NCSemanticTextStemmer, elemsFile: File):
NCSemanticEntityParserImpl =
+ def apply(stemmer: NCSemanticTextStemmer, mdlFile: File):
NCSemanticEntityParserImpl =
new NCSemanticEntityParserImpl(stemmer, null, null)
- def apply(stemmer: NCSemanticTextStemmer, elemsSrc: String):
NCSemanticEntityParserImpl =
+ def apply(stemmer: NCSemanticTextStemmer, mdlSrc: String):
NCSemanticEntityParserImpl =
new NCSemanticEntityParserImpl(stemmer, null, null)
private final val SUSP_SYNS_CHARS = Seq("?", "*", "+")