Package org.apache.nlpcraft.model
Class NCTokenPredicateResult
- java.lang.Object
-
- org.apache.nlpcraft.model.NCTokenPredicateResult
-
public class NCTokenPredicateResult extends Object
Result value of user-defined IDL term token predicate.Read full documentation in Intent Matching section and review examples.
- See Also:
NCTokenPredicateContext
-
-
Constructor Summary
Constructors Constructor Description NCTokenPredicateResult(boolean res, int tokUses)
Creates token predicate result.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
getResult()
Gets result of this predicate.int
getTokenUses()
Gets how many times a token was used to match this predicate (ifresult
istrue
).
-
-
-
Constructor Detail
-
NCTokenPredicateResult
public NCTokenPredicateResult(boolean res, int tokUses)
Creates token predicate result.- Parameters:
res
- Token predicate result.tokUses
- How many times a token was used to match this predicate (ifresult
istrue
). 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.
-
-
Method Detail
-
getResult
public boolean getResult()
Gets result of this predicate.True
means that the term was matched,false
otherwise.- Returns:
- Predicate result.
-
getTokenUses
public int getTokenUses()
Gets how many times a token was used to match this predicate (ifresult
istrue
). The zero value indicates that term was matched without usingNCTokenPredicateContext.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.- Returns:
- Number of times a token was used to match this term. Must be greater than or equal to zero.
-
-