This is an automated email from the ASF dual-hosted git repository.
aradzinski pushed a commit to branch NLPCRAFT-278
in repository https://gitbox.apache.org/repos/asf/incubator-nlpcraft.git
The following commit(s) were added to refs/heads/NLPCRAFT-278 by this push:
new 49d91e8 WIP.
49d91e8 is described below
commit 49d91e8e0107772f15140ff51d5910bf00931ad4
Author: Aaron Radzinski <[email protected]>
AuthorDate: Thu Mar 25 01:35:48 2021 -0700
WIP.
---
.../org/apache/nlpcraft/model/NCTokenPredicateContext.java | 3 +--
.../org/apache/nlpcraft/model/NCTokenPredicateResult.java | 10 +++++++---
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateContext.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateContext.java
index 1f45736..283c836 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateContext.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateContext.java
@@ -20,8 +20,7 @@ package org.apache.nlpcraft.model;
import java.util.Optional;
/**
- * Context passed into custom user-defined token predicate. Custom token
predicates can be used in
- * IDL.
+ * Context passed into custom user-defined IDL term token predicate.
* <p>
* Read full documentation in <a target=_
href="https://nlpcraft.apache.org/intent-matching.html">Intent Matching</a>
section and review
* <a target=_
href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/">examples</a>.
diff --git
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateResult.java
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateResult.java
index 07c3b99..f1b6678 100644
---
a/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateResult.java
+++
b/nlpcraft/src/main/scala/org/apache/nlpcraft/model/NCTokenPredicateResult.java
@@ -18,7 +18,7 @@
package org.apache.nlpcraft.model;
/**
- * Result value of user-defined token predicate. Token predicates can be used
in IDL.
+ * Result value of user-defined IDL term token predicate.
* <p>
* Read full documentation in <a target=_
href="https://nlpcraft.apache.org/intent-matching.html">Intent Matching</a>
section and review
* <a target=_
href="https://github.com/apache/incubator-nlpcraft/tree/master/nlpcraft/src/main/scala/org/apache/nlpcraft/examples/">examples</a>.
@@ -35,6 +35,7 @@ public class NCTokenPredicateResult {
* @param res Token predicate result.
* @param tokUses How many times a token was used to match this predicate
(if {@link #getResult() result} is {@code true}).
* The more times a token was used the "stronger" the this match will
be when used by intent solver.
+ * Must be greater than or equal to zero.
*/
public NCTokenPredicateResult(boolean res, int tokUses) {
this.res = res;
@@ -42,7 +43,7 @@ public class NCTokenPredicateResult {
}
/**
- * Gets result of this predicate.
+ * Gets result of this predicate. {@code True} means that the term was
matched, {@code false} otherwise.
*
* @return Predicate result.
*/
@@ -52,8 +53,11 @@ public class NCTokenPredicateResult {
/**
* Gets how many times a token was used to match this predicate (if {@link
#getResult() result} is {@code true}).
+ * The zero value indicates that term was matched without using {@link
NCTokenPredicateContext#getToken()}.
+ * Values greater than zero indicate that a token was used (once or more
times) during term matching. Note also
+ * that greater token use value means greater match weight for the given
term.
*
- * @return Number of times a token was used to match this term.
+ * @return Number of times a token was used to match this term. Must be
greater than or equal to zero.
*/
public int getTokenUses() {
return tokUses;