Uses of Class
com.gengoai.hermes.extraction.lyre.LyreExpression
-
Packages that use LyreExpression Package Description com.gengoai.hermes.extraction com.gengoai.hermes.extraction.keyword com.gengoai.hermes.extraction.lyre com.gengoai.hermes.lexicon -
-
Uses of LyreExpression in com.gengoai.hermes.extraction
Fields in com.gengoai.hermes.extraction declared as LyreExpression Modifier and Type Field Description protected LyreExpression
MultiPhaseExtractor.MultiPhaseExtractorBuilder. filter
protected @NonNull LyreExpression
MultiPhaseExtractor.MultiPhaseExtractorBuilder. toString
protected LyreExpression
MultiPhaseExtractor.MultiPhaseExtractorBuilder. trim
Methods in com.gengoai.hermes.extraction with parameters of type LyreExpression Modifier and Type Method Description V
MultiPhaseExtractor.MultiPhaseExtractorBuilder. filter(LyreExpression expression)
Sets the filter to use to eliminate annotations from the extractionV
MultiPhaseExtractor.MultiPhaseExtractorBuilder. toString(LyreExpression expression)
Sets the method for mapping annotations to Strings.V
MultiPhaseExtractor.MultiPhaseExtractorBuilder. trim(LyreExpression expression)
Sets the method for trimming annotations. -
Uses of LyreExpression in com.gengoai.hermes.extraction.keyword
Constructors in com.gengoai.hermes.extraction.keyword with parameters of type LyreExpression Constructor Description RakeKeywordExtractor(@NonNull LyreExpression toStringExpression)
Instantiates a new Rake keyword extractor. -
Uses of LyreExpression in com.gengoai.hermes.extraction.lyre
Fields in com.gengoai.hermes.extraction.lyre declared as LyreExpression Modifier and Type Field Description static LyreExpression
LyreDSL. $_
Returns the current Object being processed.static LyreExpression
LyreDSL. binary
Converts a list of values into binary features over the current HString.static LyreExpression
LyreDSL. exists
Predicate checking if the current Object is null.static LyreExpression
LyreDSL. FALSE
Returns a constant false valuestatic LyreExpression
LyreDSL. frequency
Converts a list of values into features with raw counts (i.e.static LyreExpression
LyreDSL. hasStopWord
Predicate checking if the current HString contains a stop wordstatic LyreExpression
LyreDSL. isAlphaNumeric
Predicate checking if the current HString contains all alphanumeric charactersstatic LyreExpression
LyreDSL. isContentWord
Predicate checking if the current HString is a content wordstatic LyreExpression
LyreDSL. isDigit
Predicate checking if the current HString is a digitstatic LyreExpression
LyreDSL. isLetter
Predicate checking if the current HString is all lettersstatic LyreExpression
LyreDSL. isLower
Predicate checking if the current HString is lower casestatic LyreExpression
LyreDSL. isPunctuation
Predicate checking if the current HString is all punctuationstatic LyreExpression
LyreDSL. isStopWord
Predicate checking if the current HString is a stop wordstatic LyreExpression
LyreDSL. isUpper
Predicate checking if the current HString is upper casestatic LyreExpression
LyreDSL. isWhitespace
Returns TRUE if the given object is whitespacestatic LyreExpression
LyreDSL. l1
Converts a list of values into features with L1-normalized counts.static LyreExpression
LyreDSL. lemma
Gets the lemmatized form of the current HString.static LyreExpression
LyreDSL. len
Determines the length of the current Object (characters if CharSequence, elements if Collection)static LyreExpression
LyreDSL. llen
Determines the size of the current Object treating it as a liststatic LyreExpression
LyreDSL. lower
Gets the lower-cased string form of the current HString.static LyreExpression
LyreDSL. MATCH_ALL
Returns a constant true value for any objectstatic LyreExpression
LyreDSL. NAN
Returns a constant NaN valuestatic LyreExpression
LyreDSL. NEGATIVE_INFINITY
Returns a constant Negative Infinity valuestatic LyreExpression
LyreDSL. NULL
Returns a constant null value.static LyreExpression
LyreDSL. pos
Returns the part-of-speech of the current HString.static LyreExpression
LyreDSL. POSITIVE_INFINITY
Returns a constant Positive Infinity valuestatic LyreExpression
LyreDSL. sentences
Returns all SENTENCES of the given type overlapping with the current HStringstatic LyreExpression
LyreDSL. stem
Gets the stemmed form of the current HString.static LyreExpression
LyreDSL. string
Gets the string form of the current Object.static LyreExpression
LyreDSL. tlen
Determines the length of the current Object (characters if CharSequence, elements if Collection)static LyreExpression
LyreDSL. tokens
Returns all TOKENS of the given type overlapping with the current HStringstatic LyreExpression
LyreDSL. trim
Trims stopwords from the current HStringstatic LyreExpression
LyreDSL. TRUE
Returns a constant true valuestatic LyreExpression
LyreDSL. upos
Returns the universal part-of-speech of the current HString.static LyreExpression
LyreDSL. upper
Gets the upper-cased string form of the current HString.Methods in com.gengoai.hermes.extraction.lyre that return LyreExpression Modifier and Type Method Description static LyreExpression
LyreDSL. all(@NonNull LyreExpression list, @NonNull LyreExpression predicate)
Returns true if all items in the given list evaluates to *true* for the given predicate expression.static LyreExpression
LyreDSL. and(@NonNull LyreExpression left, @NonNull LyreExpression right)
Returns true when the left-hand and right-hand expressions evaluate to truestatic LyreExpression
LyreDSL. andPipe(@NonNull LyreExpression... expressions)
Sequentially processes each expression with the output of the previous expression or the input object for the first expression.static LyreExpression
LyreDSL. annotation(@NonNull AnnotationType type)
Returns all annotations of the given type overlapping with the current HStringstatic LyreExpression
LyreDSL. annotation(@NonNull AnnotationType type, @NonNull LyreExpression expression)
Returns all annotations of the given type overlapping with the HString resulting from the given expression.static LyreExpression
LyreDSL. annotation(@NonNull AnnotationType type, @NonNull LyreExpression expression, String tag)
Returns all annotations of the given type overlapping with the HString resulting from the given expression.static LyreExpression
LyreDSL. annotation(@NonNull AnnotationType type, String tag)
Returns all annotations of the given type overlapping with the current HStringstatic LyreExpression
LyreDSL. any(@NonNull LyreExpression list, @NonNull LyreExpression predicate)
Returns true if any item in the given list evaluates to *true* for the given predicate expression.static LyreExpression
LyreDSL. apply(@NonNull LyreExpression object, @NonNull LyreExpression operator)
Applies the right-hand expression on the object resulting from the left-hand expression.static LyreExpression
LyreDSL. array(@NonNull LyreExpression... elements)
Creates an array of expressions.static LyreExpression
LyreDSL. attribute(@NonNull AttributeType<?> type)
Returns the value of the given AttributeType on the current HString.static LyreExpression
LyreDSL. attribute(@NonNull AttributeType<?> type, @NonNull LyreExpression expression)
Returns the value of the given AttributeType on the HString resulting from the given expressionstatic LyreExpression
LyreDSL. binary(@NonNull LyreExpression expression)
Converts a list of values into binary features.static LyreExpression
LyreDSL. binary(String prefix)
Converts a list of values into binary features over the current HString.static LyreExpression
LyreDSL. binary(String prefix, @NonNull LyreExpression expression)
Converts a list of values into binary features.static LyreExpression
LyreDSL. context(@NonNull LyreExpression expression, int relative_position)
Gets a contextual (previous or next) token for the given HString at the given position (relative).static LyreExpression
LyreDSL. context(@NonNull LyreExpression expression, @NonNull LyreExpression relative_position)
Gets a contextual (previous or next) token for the given HString at the given position (relative).static LyreExpression
LyreDSL. count(@NonNull LyreExpression expression)
Counts the items resulting from the given expression (treated as a list) and applies a Frequency ValueCalculator to the result.static LyreExpression
LyreDSL. count(@NonNull LyreExpression expression, @NonNull LyreExpression valueCalculator)
Counts the items resulting from the given expression (treated as a list) and applies the given ValueCalculator to the result.static LyreExpression
LyreDSL. count(@NonNull LyreExpression expression, @NonNull ValueCalculator valueCalculator)
Counts the items resulting from the given expression (treated as a list) and applies the given ValueCalculator to the result.static LyreExpression
LyreDSL. dep(@NonNull RelationDirection direction)
Gets the annotation(s) having a dependency relation in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. dep(@NonNull RelationDirection direction, @NonNull LyreExpression expression)
Gets the annotation(s) having the following dependency relation in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. dep(@NonNull RelationDirection direction, String relation)
Gets the annotation(s) having the following dependency relation in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. dep(@NonNull RelationDirection direction, String relation, @NonNull LyreExpression expression)
Gets the annotation(s) having the following dependency relation in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. eq(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left and right expression are equal using.equals
, checking for content equality for HStrings and literals, and usingTag.isInstance(Tag)
for tags.static LyreExpression
LyreDSL. eq(LyreExpression left, double value)
Checks if the left and right expression are equal using.equals
, checking for content equality for HStrings and literals, and usingTag.isInstance(Tag)
for tags.static LyreExpression
LyreDSL. exists(@NonNull LyreExpression expression)
Predicate checking if the Object returned from the given expression exists meaning it is not null and not a blank CharSequence or empty list.static LyreExpression
LyreDSL. feature(@NonNull ValueCalculator calculator)
Converts a list of values into features.static LyreExpression
LyreDSL. feature(@NonNull ValueCalculator calculator, @NonNull LyreExpression expression)
Converts a list of values into features.static LyreExpression
LyreDSL. feature(String prefix, @NonNull ValueCalculator calculator)
Converts a list of values into features.static LyreExpression
LyreDSL. feature(String prefix, @NonNull ValueCalculator calculator, @NonNull LyreExpression expression)
Converts a list of values into features.static LyreExpression
LyreDSL. filter(@NonNull LyreExpression list, @NonNull LyreExpression predicate)
filters a list keeping only those elements that given predicate evaluates true for.static LyreExpression
LyreDSL. first(@NonNull LyreExpression list)
Return the first element of a list expression or null if none.static LyreExpression
LyreDSL. flatten(@NonNull LyreExpression list)
Flattens all elements in a list recursively.static LyreExpression
LyreDSL. frequency(@NonNull LyreExpression expression)
Converts a list of values into features with raw counts (i.e.static LyreExpression
LyreDSL. frequency(String prefix)
Converts a list of values into features with raw counts (i.e.static LyreExpression
LyreDSL. frequency(String prefix, @NonNull LyreExpression expression)
Converts a list of values into features with raw counts (i.e.static LyreExpression
LyreDSL. get(@NonNull LyreExpression list, int index)
Gets the i-th element in the given list or null if the index is invalidstatic LyreExpression
LyreDSL. get(@NonNull LyreExpression listExpression, @NonNull LyreExpression index)
Gets the i-th element in the given list or null if the index is invalidstatic LyreExpression
LyreDSL. gt(@NonNull LyreExpression left, double value)
Checks if the left-hand expression is greater than the right-hand expression.static LyreExpression
LyreDSL. gt(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left-hand expression is greater than the right-hand expression.static LyreExpression
LyreDSL. gte(@NonNull LyreExpression left, double value)
Checks if the left-hand expression is greater than or equal to the right-hand expression.static LyreExpression
LyreDSL. gte(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left-hand expression is greater than or equal to the right-hand expression.static LyreExpression
LyreDSL. has(@NonNull LyreExpression container, @NonNull LyreExpression expression)
Checks if any annotations on the HString resulting from the left-hand expression evaluates to true using the right-hand expression.static LyreExpression
LyreDSL. hasStopWord(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression contains a stop wordstatic LyreExpression
LyreDSL. ifThen(@NonNull LyreExpression condition, @NonNull LyreExpression whenTrue, @NonNull LyreExpression whenFalse)
IF then function to perform a given true or false expression based on a given condition.static LyreExpression
LyreDSL. in(@NonNull LyreExpression object, @NonNull LyreExpression container)
Checks if the left-hand object is "in" the right-hand object, where in means "contains".static LyreExpression
LyreDSL. interleave(@NonNull AnnotationType... types)
Returns all annotations of the given types in interleaved fashion (seeHString.interleaved(AnnotationType...)
**static LyreExpression
LyreDSL. iob(@NonNull AnnotationType type)
Generates IOB-formatted tags for the given expressionstatic LyreExpression
LyreDSL. iob(@NonNull AnnotationType type, @NonNull LyreExpression expression)
Generates IOB-formatted tags for the given expressionstatic LyreExpression
LyreDSL. iob(@NonNull LyreExpression type)
Generates IOB-formatted tags for the given expressionstatic LyreExpression
LyreDSL. iob(@NonNull LyreExpression type, @NonNull LyreExpression expression)
Generates IOB-formatted tags for the given expressionstatic LyreExpression
LyreDSL. isAlphaNumeric(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression contains all alphanumeric charactersstatic LyreExpression
LyreDSL. isContentWord(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is a content wordstatic LyreExpression
LyreDSL. isDigit(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is a digitstatic LyreExpression
LyreDSL. isLetter(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is all lettersstatic LyreExpression
LyreDSL. isLower(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is lower casestatic LyreExpression
LyreDSL. isPunctuation(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is all punctuationstatic LyreExpression
LyreDSL. isStopWord(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is a stop wordstatic LyreExpression
LyreDSL. isUpper(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is uppercasestatic LyreExpression
LyreDSL. isWhitespace(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is all whitespacestatic LyreExpression
LyreDSL. l1(@NonNull LyreExpression expression)
Converts a list of values into features with L1-normalized counts.static LyreExpression
LyreDSL. l1(String prefix)
Converts a list of values into features with L1-normalized counts.static LyreExpression
LyreDSL. l1(String prefix, @NonNull LyreExpression expression)
Converts a list of values into features with L1-normalized counts.static LyreExpression
LyreDSL. last(@NonNull LyreExpression list)
Return the last element of a list expression or null if none.static LyreExpression
LyreDSL. lemma(@NonNull LyreExpression expression)
Gets the lemmatized form of the current HString resulting from the given expression.static LyreExpression
LyreDSL. len(@NonNull LyreExpression expression)
Determines the length of the current Object (characters if CharSequence, elements if Collection)static LyreExpression
LyreDSL. lexicon(@NonNull String name)
Returns theLexicon
with the given name.static LyreExpression
LyreDSL. list(@NonNull List<LyreExpression> elements)
Creates an array of expressions.static LyreExpression
LyreDSL. literal(@NonNull String value)
Lyre allows for string literals to be specified using single quotes (').static LyreExpression
LyreDSL. literalArray(Iterator<String> literals)
Convenience method for constructing an array (list) of literal values.static LyreExpression
LyreDSL. llen(@NonNull LyreExpression expression)
Determines the length of the current Object treating it as a list.static LyreExpression
LyreDSL. longest(@NonNull LyreExpression list)
Return the longest (character length) element of a list expression or null if none.static LyreExpression
LyreDSL. lookAhead(@NonNull LyreExpression condition, @NonNull LyreExpression expression)
Determines if the next annotation matches the given condition (Positive Lookahead).static LyreExpression
LyreDSL. lookBehind(@NonNull LyreExpression condition, @NonNull LyreExpression expression)
Determines if the previous annotation matches the given expression (Positive Lookbehind).static LyreExpression
LyreDSL. lower(@NonNull LyreExpression expression)
Gets the lower-cased string form of the current HString resulting from the given expression.static LyreExpression
LyreDSL. lpad(@NonNull LyreExpression expression, int minimumLength, char paddingCharacter)
Pads the left-side of CharSequence with a given pad-character ensuring that length of CharSequence is at least the given minimum length.static LyreExpression
LyreDSL. lpad(@NonNull LyreExpression expression, @NonNull LyreExpression minimumLength, @NonNull LyreExpression paddingCharacter)
Pads the left-side of CharSequence with a given pad-character ensuring that length of CharSequence is at least the given minimum length.static LyreExpression
LyreDSL. lt(@NonNull LyreExpression left, double value)
Checks if the left-hand expression is less than the right-hand expression.static LyreExpression
LyreDSL. lt(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left-hand expression is less than the right-hand expression.static LyreExpression
LyreDSL. lte(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left-hand expression is less than or equal to the right-hand expression.static LyreExpression
LyreDSL. lte(LyreExpression left, double value)
Checks if the left-hand expression is less than or equal to the right-hand expression.static LyreExpression
LyreDSL. map(@NonNull LyreExpression list, @NonNull LyreExpression operator)
Applies the given operator to each element of the given list.static LyreExpression
LyreDSL. max(@NonNull LyreExpression list)
Return the annotation in the list expression with maximumconfidence
as obtained via theCONFIDENCE
attribute or null if none.static LyreExpression
LyreDSL. ne(@NonNull LyreExpression left, double value)
Checks if the left and right expression are not equal using.equals
, checking for content equality for HStrings and literals, and usingTag.isInstance(Tag)
for tags.static LyreExpression
LyreDSL. ne(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left and right expression are not equal using.equals
, checking for content equality for HStrings and literals, and usingTag.isInstance(Tag)
for tags.static LyreExpression
LyreDSL. negLookAhead(@NonNull LyreExpression condition, @NonNull LyreExpression expression)
Determines if the next annotation does not match the given expression (Negative Lookahead).static LyreExpression
LyreDSL. negLookBehind(@NonNull LyreExpression condition, @NonNull LyreExpression expression)
Determines if the previous annotation does not match the given expression (Negative Lookbehind).static LyreExpression
LyreDSL. none(@NonNull LyreExpression list, @NonNull LyreExpression predicate)
Returns true if none of the items in the given list evaluates to *true* for the given predicate expression.static LyreExpression
LyreDSL. not(@NonNull LyreExpression predicate)
Negates the given predicate expressionstatic LyreExpression
LyreDSL. notNull(@NonNull LyreExpression expression, @NonNull LyreExpression defaultValue)
Checks if the result a given expression is null or not and when it is not null returns the result and when is null returns a default value.static LyreExpression
LyreDSL. number(double number)
Lyres accepts numerical literal values in the form of ints and doubles and allows for scientific notation.static LyreExpression
LyreDSL. or(@NonNull LyreExpression left, @NonNull LyreExpression right)
Returns true when the left-hand or right-hand expressions evaluate to truestatic LyreExpression
LyreDSL. orPipe(@NonNull LyreExpression... expressions)
Sequentially processes each expression with the input object, returning the result of the first expression that evaluates to a non-null, non-empty list, or finite numeric value.static LyreExpression
LyreExpression. parse(String pattern)
Parse the given pattern into aLyreExpression
.static LyreExpression
LyreDSL. plus(@NonNull LyreExpression... expressions)
The plus operator can be used to concatenate strings, perform addition on numeric values, or append to a list.static LyreExpression
LyreDSL. plus(@NonNull LyreExpression left, @NonNull LyreExpression right)
The plus operator can be used to concatenate strings, perform addition on numeric values, or append to a list.static LyreExpression
LyreDSL. pos(@NonNull LyreExpression expression)
Gets the part-of-speech for the HString resulting from the given expression.static LyreExpression
LyreDSL. regex(@NonNull String pattern)
Creates a predicate expression to be applied to Strings testing them against the given regular expression pattern.static LyreExpression
LyreDSL. regex(@NonNull String pattern, boolean matchFullSpan)
Creates a predicate expression to be applied to Strings testing them against the given regular expression pattern.static LyreExpression
LyreDSL. rel(@NonNull RelationDirection direction, @NonNull RelationType type)
Gets the annotation(s) having the given relation type in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. rel(@NonNull RelationDirection direction, @NonNull RelationType type, @NonNull LyreExpression expression)
Gets the annotation(s) having the given relation type in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. rel(@NonNull RelationDirection direction, @NonNull RelationType type, String relation)
Gets the annotation(s) having the the given relation type with the given relation value in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. rel(@NonNull RelationDirection direction, @NonNull RelationType type, String relation, @NonNull LyreExpression expression)
Gets the annotation(s) having the the given relation type with the given relation value in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. rpad(@NonNull LyreExpression expression, int minimumLength, char paddingCharacter)
Pads the right-side of CharSequence with a given pad-character ensuring that length of CharSequence is at least the given minimum length.static LyreExpression
LyreDSL. rpad(@NonNull LyreExpression expression, @NonNull LyreExpression minimumLength, @NonNull LyreExpression paddingCharacter)
Pads the right-side of CharSequence with a given pad-character ensuring that length of CharSequence is at least the given minimum length.static LyreExpression
LyreDSL. rsub(@NonNull String pattern, @NonNull String replacement)
Creates a regular expression substitution expression to be applied to Strings.static LyreExpression
LyreDSL. rsub(@NonNull String pattern, @NonNull String replacement, boolean replaceAll)
Creates a regular expression substitution expression to be applied to Strings.static LyreExpression
LyreDSL. slice(@NonNull LyreExpression expression, int start)
Performs a slice (substring and sublist) on Strings and Collections.static LyreExpression
LyreDSL. slice(@NonNull LyreExpression expression, int start, int end)
Performs a slice (substring and sublist) on Strings and Collections.static LyreExpression
LyreDSL. stem(@NonNull LyreExpression expression)
Gets the stemmed form of the current HString resulting from the given expression.static LyreExpression
LyreDSL. string(@NonNull LyreExpression expression)
Gets the string form of the Object resulting from the given expression.static LyreExpression
LyreDSL. tag(@NonNull Tag value)
Checks if the Tag on the current HString is of the given Tag value.static LyreExpression
LyreDSL. tag(@NonNull Tag value, @NonNull LyreExpression expression)
Checks if the Tag on the HString resulting from the given expression is of the given Tag value.static LyreExpression
LyreDSL. tag(@NonNull String value)
Checks if the Tag on the current HString is of the given Tag value.static LyreExpression
LyreDSL. tag(@NonNull String value, @NonNull LyreExpression expression)
Checks if the Tag on the HString resulting from the given expression is of the given Tag value.static LyreExpression
LyreDSL. tlen(@NonNull LyreExpression expression)
Returns the length of the underlying HString in Tokensstatic LyreExpression
LyreDSL. trim(@NonNull LyreExpression expression, @NonNull LyreExpression predicate)
Removes tokens from the left and right of the input HString if they evaluate to true with the given predicate.static LyreExpression
LyreDSL. upos(@NonNull LyreExpression expression)
Gets the universal part-of-speech for the HString resulting from the given expression.static LyreExpression
LyreDSL. upper(@NonNull LyreExpression expression)
Gets the upper-cased string form of the current HString resulting from the given expression.static LyreExpression
LyreDSL. when(@NonNull LyreExpression condition, @NonNull LyreExpression expression)
Performs the given expression when the given condition is true and returns null when the condition is false.static LyreExpression
LyreDSL. wordList(@NonNull LyreExpression wordList)
Constructs a temporary word list to use as a predicate or as a container for checking for the existence of words and phrases.static LyreExpression
LyreDSL. wordList(@NonNull WordList wordList)
Constructs a temporary word list to use as a predicate or as a container for checking for the existence of words and phrases.static LyreExpression
LyreDSL. xor(@NonNull LyreExpression left, @NonNull LyreExpression right)
Returns true when the left-hand or right-hand expressions evaluate to true but not bothMethods in com.gengoai.hermes.extraction.lyre with parameters of type LyreExpression Modifier and Type Method Description static LyreExpression
LyreDSL. all(@NonNull LyreExpression list, @NonNull LyreExpression predicate)
Returns true if all items in the given list evaluates to *true* for the given predicate expression.static LyreExpression
LyreDSL. and(@NonNull LyreExpression left, @NonNull LyreExpression right)
Returns true when the left-hand and right-hand expressions evaluate to truestatic LyreExpression
LyreDSL. andPipe(@NonNull LyreExpression... expressions)
Sequentially processes each expression with the output of the previous expression or the input object for the first expression.static LyreExpression
LyreDSL. annotation(@NonNull AnnotationType type, @NonNull LyreExpression expression)
Returns all annotations of the given type overlapping with the HString resulting from the given expression.static LyreExpression
LyreDSL. annotation(@NonNull AnnotationType type, @NonNull LyreExpression expression, String tag)
Returns all annotations of the given type overlapping with the HString resulting from the given expression.static LyreExpression
LyreDSL. any(@NonNull LyreExpression list, @NonNull LyreExpression predicate)
Returns true if any item in the given list evaluates to *true* for the given predicate expression.static LyreExpression
LyreDSL. apply(@NonNull LyreExpression object, @NonNull LyreExpression operator)
Applies the right-hand expression on the object resulting from the left-hand expression.static LyreExpression
LyreDSL. array(@NonNull LyreExpression... elements)
Creates an array of expressions.static LyreExpression
LyreDSL. attribute(@NonNull AttributeType<?> type, @NonNull LyreExpression expression)
Returns the value of the given AttributeType on the HString resulting from the given expressionstatic LyreExpression
LyreDSL. binary(@NonNull LyreExpression expression)
Converts a list of values into binary features.static LyreExpression
LyreDSL. binary(String prefix, @NonNull LyreExpression expression)
Converts a list of values into binary features.static LyreExpression
LyreDSL. context(@NonNull LyreExpression expression, int relative_position)
Gets a contextual (previous or next) token for the given HString at the given position (relative).static LyreExpression
LyreDSL. context(@NonNull LyreExpression expression, @NonNull LyreExpression relative_position)
Gets a contextual (previous or next) token for the given HString at the given position (relative).static LyreExpression
LyreDSL. count(@NonNull LyreExpression expression)
Counts the items resulting from the given expression (treated as a list) and applies a Frequency ValueCalculator to the result.static LyreExpression
LyreDSL. count(@NonNull LyreExpression expression, @NonNull LyreExpression valueCalculator)
Counts the items resulting from the given expression (treated as a list) and applies the given ValueCalculator to the result.static LyreExpression
LyreDSL. count(@NonNull LyreExpression expression, @NonNull ValueCalculator valueCalculator)
Counts the items resulting from the given expression (treated as a list) and applies the given ValueCalculator to the result.static LyreExpression
LyreDSL. dep(@NonNull RelationDirection direction, @NonNull LyreExpression expression)
Gets the annotation(s) having the following dependency relation in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. dep(@NonNull RelationDirection direction, String relation, @NonNull LyreExpression expression)
Gets the annotation(s) having the following dependency relation in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. eq(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left and right expression are equal using.equals
, checking for content equality for HStrings and literals, and usingTag.isInstance(Tag)
for tags.static LyreExpression
LyreDSL. eq(LyreExpression left, double value)
Checks if the left and right expression are equal using.equals
, checking for content equality for HStrings and literals, and usingTag.isInstance(Tag)
for tags.static LyreExpression
LyreDSL. exists(@NonNull LyreExpression expression)
Predicate checking if the Object returned from the given expression exists meaning it is not null and not a blank CharSequence or empty list.static LyreExpression
LyreDSL. feature(@NonNull ValueCalculator calculator, @NonNull LyreExpression expression)
Converts a list of values into features.static LyreExpression
LyreDSL. feature(String prefix, @NonNull ValueCalculator calculator, @NonNull LyreExpression expression)
Converts a list of values into features.static LyreExpression
LyreDSL. filter(@NonNull LyreExpression list, @NonNull LyreExpression predicate)
filters a list keeping only those elements that given predicate evaluates true for.static LyreExpression
LyreDSL. first(@NonNull LyreExpression list)
Return the first element of a list expression or null if none.static LyreExpression
LyreDSL. flatten(@NonNull LyreExpression list)
Flattens all elements in a list recursively.static LyreExpression
LyreDSL. frequency(@NonNull LyreExpression expression)
Converts a list of values into features with raw counts (i.e.static LyreExpression
LyreDSL. frequency(String prefix, @NonNull LyreExpression expression)
Converts a list of values into features with raw counts (i.e.static LyreExpression
LyreDSL. get(@NonNull LyreExpression list, int index)
Gets the i-th element in the given list or null if the index is invalidstatic LyreExpression
LyreDSL. get(@NonNull LyreExpression listExpression, @NonNull LyreExpression index)
Gets the i-th element in the given list or null if the index is invalidstatic LyreExpression
LyreDSL. gt(@NonNull LyreExpression left, double value)
Checks if the left-hand expression is greater than the right-hand expression.static LyreExpression
LyreDSL. gt(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left-hand expression is greater than the right-hand expression.static LyreExpression
LyreDSL. gte(@NonNull LyreExpression left, double value)
Checks if the left-hand expression is greater than or equal to the right-hand expression.static LyreExpression
LyreDSL. gte(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left-hand expression is greater than or equal to the right-hand expression.static LyreExpression
LyreDSL. has(@NonNull LyreExpression container, @NonNull LyreExpression expression)
Checks if any annotations on the HString resulting from the left-hand expression evaluates to true using the right-hand expression.static LyreExpression
LyreDSL. hasStopWord(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression contains a stop wordstatic LyreExpression
LyreDSL. ifThen(@NonNull LyreExpression condition, @NonNull LyreExpression whenTrue, @NonNull LyreExpression whenFalse)
IF then function to perform a given true or false expression based on a given condition.static LyreExpression
LyreDSL. in(@NonNull LyreExpression object, @NonNull LyreExpression container)
Checks if the left-hand object is "in" the right-hand object, where in means "contains".static LyreExpression
LyreDSL. iob(@NonNull AnnotationType type, @NonNull LyreExpression expression)
Generates IOB-formatted tags for the given expressionstatic LyreExpression
LyreDSL. iob(@NonNull LyreExpression type)
Generates IOB-formatted tags for the given expressionstatic LyreExpression
LyreDSL. iob(@NonNull LyreExpression type, @NonNull LyreExpression expression)
Generates IOB-formatted tags for the given expressionstatic LyreExpression
LyreDSL. isAlphaNumeric(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression contains all alphanumeric charactersstatic LyreExpression
LyreDSL. isContentWord(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is a content wordstatic LyreExpression
LyreDSL. isDigit(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is a digitstatic LyreExpression
LyreDSL. isLetter(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is all lettersstatic LyreExpression
LyreDSL. isLower(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is lower casestatic LyreExpression
LyreDSL. isPunctuation(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is all punctuationstatic LyreExpression
LyreDSL. isStopWord(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is a stop wordstatic LyreExpression
LyreDSL. isUpper(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is uppercasestatic LyreExpression
LyreDSL. isWhitespace(@NonNull LyreExpression expression)
Predicate checking if the HString returned from the given expression is all whitespacestatic LyreExpression
LyreDSL. l1(@NonNull LyreExpression expression)
Converts a list of values into features with L1-normalized counts.static LyreExpression
LyreDSL. l1(String prefix, @NonNull LyreExpression expression)
Converts a list of values into features with L1-normalized counts.static LyreExpression
LyreDSL. last(@NonNull LyreExpression list)
Return the last element of a list expression or null if none.static LyreExpression
LyreDSL. lemma(@NonNull LyreExpression expression)
Gets the lemmatized form of the current HString resulting from the given expression.static LyreExpression
LyreDSL. len(@NonNull LyreExpression expression)
Determines the length of the current Object (characters if CharSequence, elements if Collection)static LyreExpression
LyreDSL. llen(@NonNull LyreExpression expression)
Determines the length of the current Object treating it as a list.static LyreExpression
LyreDSL. longest(@NonNull LyreExpression list)
Return the longest (character length) element of a list expression or null if none.static LyreExpression
LyreDSL. lookAhead(@NonNull LyreExpression condition, @NonNull LyreExpression expression)
Determines if the next annotation matches the given condition (Positive Lookahead).static LyreExpression
LyreDSL. lookBehind(@NonNull LyreExpression condition, @NonNull LyreExpression expression)
Determines if the previous annotation matches the given expression (Positive Lookbehind).static LyreExpression
LyreDSL. lower(@NonNull LyreExpression expression)
Gets the lower-cased string form of the current HString resulting from the given expression.static LyreExpression
LyreDSL. lpad(@NonNull LyreExpression expression, int minimumLength, char paddingCharacter)
Pads the left-side of CharSequence with a given pad-character ensuring that length of CharSequence is at least the given minimum length.static LyreExpression
LyreDSL. lpad(@NonNull LyreExpression expression, @NonNull LyreExpression minimumLength, @NonNull LyreExpression paddingCharacter)
Pads the left-side of CharSequence with a given pad-character ensuring that length of CharSequence is at least the given minimum length.static LyreExpression
LyreDSL. lt(@NonNull LyreExpression left, double value)
Checks if the left-hand expression is less than the right-hand expression.static LyreExpression
LyreDSL. lt(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left-hand expression is less than the right-hand expression.static LyreExpression
LyreDSL. lte(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left-hand expression is less than or equal to the right-hand expression.static LyreExpression
LyreDSL. lte(LyreExpression left, double value)
Checks if the left-hand expression is less than or equal to the right-hand expression.static LyreExpression
LyreDSL. map(@NonNull LyreExpression list, @NonNull LyreExpression operator)
Applies the given operator to each element of the given list.static LyreExpression
LyreDSL. max(@NonNull LyreExpression list)
Return the annotation in the list expression with maximumconfidence
as obtained via theCONFIDENCE
attribute or null if none.static LyreExpression
LyreDSL. ne(@NonNull LyreExpression left, double value)
Checks if the left and right expression are not equal using.equals
, checking for content equality for HStrings and literals, and usingTag.isInstance(Tag)
for tags.static LyreExpression
LyreDSL. ne(@NonNull LyreExpression left, @NonNull LyreExpression right)
Checks if the left and right expression are not equal using.equals
, checking for content equality for HStrings and literals, and usingTag.isInstance(Tag)
for tags.static LyreExpression
LyreDSL. negLookAhead(@NonNull LyreExpression condition, @NonNull LyreExpression expression)
Determines if the next annotation does not match the given expression (Negative Lookahead).static LyreExpression
LyreDSL. negLookBehind(@NonNull LyreExpression condition, @NonNull LyreExpression expression)
Determines if the previous annotation does not match the given expression (Negative Lookbehind).static LyreExpression
LyreDSL. none(@NonNull LyreExpression list, @NonNull LyreExpression predicate)
Returns true if none of the items in the given list evaluates to *true* for the given predicate expression.static LyreExpression
LyreDSL. not(@NonNull LyreExpression predicate)
Negates the given predicate expressionstatic LyreExpression
LyreDSL. notNull(@NonNull LyreExpression expression, @NonNull LyreExpression defaultValue)
Checks if the result a given expression is null or not and when it is not null returns the result and when is null returns a default value.static LyreExpression
LyreDSL. or(@NonNull LyreExpression left, @NonNull LyreExpression right)
Returns true when the left-hand or right-hand expressions evaluate to truestatic LyreExpression
LyreDSL. orPipe(@NonNull LyreExpression... expressions)
Sequentially processes each expression with the input object, returning the result of the first expression that evaluates to a non-null, non-empty list, or finite numeric value.static LyreExpression
LyreDSL. plus(@NonNull LyreExpression... expressions)
The plus operator can be used to concatenate strings, perform addition on numeric values, or append to a list.static LyreExpression
LyreDSL. plus(@NonNull LyreExpression left, @NonNull LyreExpression right)
The plus operator can be used to concatenate strings, perform addition on numeric values, or append to a list.static LyreExpression
LyreDSL. pos(@NonNull LyreExpression expression)
Gets the part-of-speech for the HString resulting from the given expression.static LyreExpression
LyreDSL. rel(@NonNull RelationDirection direction, @NonNull RelationType type, @NonNull LyreExpression expression)
Gets the annotation(s) having the given relation type in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. rel(@NonNull RelationDirection direction, @NonNull RelationType type, String relation, @NonNull LyreExpression expression)
Gets the annotation(s) having the the given relation type with the given relation value in the given direction (INCOMING or OUTGOING).static LyreExpression
LyreDSL. rpad(@NonNull LyreExpression expression, int minimumLength, char paddingCharacter)
Pads the right-side of CharSequence with a given pad-character ensuring that length of CharSequence is at least the given minimum length.static LyreExpression
LyreDSL. rpad(@NonNull LyreExpression expression, @NonNull LyreExpression minimumLength, @NonNull LyreExpression paddingCharacter)
Pads the right-side of CharSequence with a given pad-character ensuring that length of CharSequence is at least the given minimum length.static LyreExpression
LyreDSL. slice(@NonNull LyreExpression expression, int start)
Performs a slice (substring and sublist) on Strings and Collections.static LyreExpression
LyreDSL. slice(@NonNull LyreExpression expression, int start, int end)
Performs a slice (substring and sublist) on Strings and Collections.static LyreExpression
LyreDSL. stem(@NonNull LyreExpression expression)
Gets the stemmed form of the current HString resulting from the given expression.static LyreExpression
LyreDSL. string(@NonNull LyreExpression expression)
Gets the string form of the Object resulting from the given expression.static LyreExpression
LyreDSL. tag(@NonNull Tag value, @NonNull LyreExpression expression)
Checks if the Tag on the HString resulting from the given expression is of the given Tag value.static LyreExpression
LyreDSL. tag(@NonNull String value, @NonNull LyreExpression expression)
Checks if the Tag on the HString resulting from the given expression is of the given Tag value.static LyreExpression
LyreDSL. tlen(@NonNull LyreExpression expression)
Returns the length of the underlying HString in Tokensstatic LyreExpression
LyreDSL. trim(@NonNull LyreExpression expression, @NonNull LyreExpression predicate)
Removes tokens from the left and right of the input HString if they evaluate to true with the given predicate.static LyreExpression
LyreDSL. upos(@NonNull LyreExpression expression)
Gets the universal part-of-speech for the HString resulting from the given expression.static LyreExpression
LyreDSL. upper(@NonNull LyreExpression expression)
Gets the upper-cased string form of the current HString resulting from the given expression.static LyreExpression
LyreDSL. when(@NonNull LyreExpression condition, @NonNull LyreExpression expression)
Performs the given expression when the given condition is true and returns null when the condition is false.static LyreExpression
LyreDSL. wordList(@NonNull LyreExpression wordList)
Constructs a temporary word list to use as a predicate or as a container for checking for the existence of words and phrases.static LyreExpression
LyreDSL. xor(@NonNull LyreExpression left, @NonNull LyreExpression right)
Returns true when the left-hand or right-hand expressions evaluate to true but not bothMethod parameters in com.gengoai.hermes.extraction.lyre with type arguments of type LyreExpression Modifier and Type Method Description protected static LyreExpressionType
LyreExpressionType. determineCommonType(@NonNull Collection<LyreExpression> expressions)
static LyreExpression
LyreDSL. list(@NonNull List<LyreExpression> elements)
Creates an array of expressions. -
Uses of LyreExpression in com.gengoai.hermes.lexicon
Methods in com.gengoai.hermes.lexicon with parameters of type LyreExpression Modifier and Type Method Description static LexiconEntry
LexiconEntry. of(@NonNull String lemma, double probability, String tag, LyreExpression constraint, int tokenLength)
Constructs a LexiconEntry for the given lemma which has the given probability, tag, constraint, and token length.
-