This is an automated email from the ASF dual-hosted git repository.
aradzinski 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 110fa922 WIP javadoc.
110fa922 is described below
commit 110fa922b2c2de7c12d03f4ef4ba5ef2d0472b26
Author: Aaron Radzinski <[email protected]>
AuthorDate: Tue Apr 5 09:19:47 2022 -0700
WIP javadoc.
---
.../org/apache/nlpcraft/NCEntityEnricher.java | 2 +-
.../scala/org/apache/nlpcraft/NCEntityMapper.java | 24 +++++++++++++++++-----
.../scala/org/apache/nlpcraft/NCEntityParser.java | 2 +-
.../org/apache/nlpcraft/NCEntityValidator.java | 2 +-
.../main/scala/org/apache/nlpcraft/NCPipeline.java | 2 --
5 files changed, 22 insertions(+), 10 deletions(-)
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityEnricher.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityEnricher.java
index e4bfee60..902e0528 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityEnricher.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityEnricher.java
@@ -39,7 +39,7 @@ public interface NCEntityEnricher extends NCLifecycle {
* Enriches given list of entities by settings their properties.
*
* @param req Input request descriptor.
- * @param cfg Configuration of the model this components is associated
with.
+ * @param cfg Configuration of the model this component is associated with.
* @param ents List of entities to enrich.
* @throws NCException Thrown in case of any errors.
* @see NCPropertyMap
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityMapper.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityMapper.java
index f84434f0..f06fefe3 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityMapper.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityMapper.java
@@ -20,15 +20,29 @@ package org.apache.nlpcraft;
import java.util.List;
/**
- * TODO:
+ * A pipeline component that allows to map one set of entities into another
after the entities were parsed
+ * and enriched. Entity mapper is an optional component and the pipeline can
have zero or more entity mappers. Mappers
+ * are typically used for combine several existing entities into a new one
without necessarily touching the entity
+ * parser or enrichers. See {@link NCPipeline} for documentation on the
overall processing pipeline.
+ *
+ * @see NCPipeline#getEntityMappers()
+ * @see NCEntity
+ * @see NCToken
+ * @see NCTokenParser
+ * @see NCTokenEnricher
+ * @see NCTokenValidator
+ * @see NCEntityParser
+ * @see NCEntityEnricher
+ * @see NCEntityValidator
*/
public interface NCEntityMapper extends NCLifecycle {
/**
+ * Maps given of entities into a new list of entities.
*
* @param req Input request descriptor.
- * @param cfg Configuration of the model this components is associated
with.
- * @param ents List of entities to enrich.
- * @return
+ * @param cfg Configuration of the model this component is associated with.
+ * @param ents List of entities to map.
+ * @return List of entities (new or existing ones).
*/
- List<NCEntity> map(NCRequest req, NCModelConfig cfg, List<NCEntity>
entities);
+ List<NCEntity> map(NCRequest req, NCModelConfig cfg, List<NCEntity> ents);
}
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityParser.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityParser.java
index c4e432d0..d45f97cf 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityParser.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityParser.java
@@ -39,7 +39,7 @@ public interface NCEntityParser extends NCLifecycle {
* Converts, parses, given list of tokens into the list of entities.
*
* @param req Input request descriptor.
- * @param cfg Configuration of the model this components is associated
with.
+ * @param cfg Configuration of the model this component is associated with.
* @param toks List of tokens to convert.
* @return List of parsed entities, potentially empty but never {@code
null}.
* @@throws NCException Thrown in case of any errors.
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityValidator.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityValidator.java
index e8e4a336..14c54256 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityValidator.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCEntityValidator.java
@@ -38,7 +38,7 @@ public interface NCEntityValidator extends NCLifecycle {
/**
*
* @param req Input request descriptor.
- * @param cfg Configuration of the model this components is associated
with.
+ * @param cfg Configuration of the model this component is associated with.
* @param ents List of entities to validate.
* @@throws NCException Thrown in case of any validation violations.
*/
diff --git a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java
index b7b84da4..65f1f60e 100644
--- a/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java
+++ b/nlpcraft/src/main/scala/org/apache/nlpcraft/NCPipeline.java
@@ -181,8 +181,6 @@ public interface NCPipeline {
}
/**
- * TODO:
- *
* Gets optional list of entity mappers.
*
* @return Optional list of entity mappers. Can be empty but never {@code
null}.