public class TextLinesEngine extends QueryEngine
QueryModel
and is intended specifically for lines of text in any format.| Constructor and Description |
|---|
TextLinesEngine()
create a new instance of TextLinesEngine.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.ArrayList<java.lang.Integer> |
findLinesContain(java.util.ArrayList<java.lang.String> allLines,
PatternConstraint valueConstraint,
java.util.ArrayList<java.lang.Integer> currentIndexes)
Find only the lines that contain any of the words in the constraint, in any sort
of word sequence in the line.
|
java.util.ArrayList<java.lang.Integer> |
findLinesEvaluates(java.util.ArrayList<java.lang.String> allLines,
java.lang.String comparison,
java.lang.Double searchTerm,
java.util.ArrayList<java.lang.Integer> currentIndexes)
Find only the lines that evaluate to the specified equation.
|
java.util.ArrayList<java.lang.Integer> |
findLinesStartsWith(java.util.ArrayList<java.lang.String> allLines,
PatternConstraint valueConstraint,
java.util.ArrayList<java.lang.Integer> currentIndexes)
Find only the lines that start with any of the words that are in the constraint.
|
java.util.ArrayList<java.lang.Integer> |
findLinesWith(java.util.ArrayList<java.lang.String> allLines,
PatternConstraint valueConstraint,
java.util.ArrayList<java.lang.Integer> currentIndexes)
Find only the lines that contain any of the words in the constraint, as whole
words in the line.
|
java.util.ArrayList<java.lang.Integer> |
findLinesWithPlusWildcards(java.util.ArrayList<java.lang.String> allLines,
PatternConstraint valueConstraint,
java.util.ArrayList<java.lang.Integer> currentIndexes)
Find only the lines that contain any of the words in the constraint, as whole
words in the line.
|
protected java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Integer>> |
textSearch(java.util.HashMap<java.lang.String,java.lang.Object> allTexts,
java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Integer>> allIndexes,
QueryModelText queryModel)
Query the text to find matching information.
|
allowsCase, allowsWildcards, constraintIsAttribute, constraintNeedsValue, getComparisonOps, getConstraintTypes, getCorrectTextType, getLogicalOps, getReciprocalComparison, getTextTypes, getWildcardCount, isCurrencyChar, isEndConstraint, isNumericalConstraint, isNumericalQueryType, isOtherQueryType, isPatternType, isRangeConstraint, isSearchType, isSingleConstraint, isStartConstraint, isTextQueryType, isWildcard, isWildcard, isXmlQueryType, parseWildcardspublic TextLinesEngine()
protected java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Integer>> textSearch(java.util.HashMap<java.lang.String,java.lang.Object> allTexts,
java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.Integer>> allIndexes,
QueryModelText queryModel)
throws java.lang.Exception
QueryConst.ASTEXT
will trigger an otherTextSearch. The type TEXT will trigger a
processTextQuery search, while NUMERICAL will trigger a processNumericalQuery
query.allTexts - the text to process. This is a keyed list of different text
parts that each constraint can evaluate separately. A single text document
can equally be included.allIndexes - the list of current indexes to search from. This is a
keyed list valid line indexes for each of the text parts or documents.queryModel - the query to process.java.lang.Exception - any error.public java.util.ArrayList<java.lang.Integer> findLinesContain(java.util.ArrayList<java.lang.String> allLines,
PatternConstraint valueConstraint,
java.util.ArrayList<java.lang.Integer> currentIndexes)
allLines - the lines of text to process.valueConstraint - the constraint to satisfy.currentIndexes - the list of current indexes to search from.public java.util.ArrayList<java.lang.Integer> findLinesStartsWith(java.util.ArrayList<java.lang.String> allLines,
PatternConstraint valueConstraint,
java.util.ArrayList<java.lang.Integer> currentIndexes)
allLines - the lines of text to process.valueConstraint - the constraint to satisfy.currentIndexes - the list of current indexes to search from.public java.util.ArrayList<java.lang.Integer> findLinesWith(java.util.ArrayList<java.lang.String> allLines,
PatternConstraint valueConstraint,
java.util.ArrayList<java.lang.Integer> currentIndexes)
allLines - the lines of text to process.valueConstraint - the constraint to satisfy.currentIndexes - the list of current indexes to search from.public java.util.ArrayList<java.lang.Integer> findLinesWithPlusWildcards(java.util.ArrayList<java.lang.String> allLines,
PatternConstraint valueConstraint,
java.util.ArrayList<java.lang.Integer> currentIndexes)
allLines - list of text lines to process.valueConstraint - the constraint to satisfy.currentIndexes - the list of current indexes to search from.public java.util.ArrayList<java.lang.Integer> findLinesEvaluates(java.util.ArrayList<java.lang.String> allLines,
java.lang.String comparison,
java.lang.Double searchTerm,
java.util.ArrayList<java.lang.Integer> currentIndexes)
throws java.lang.Exception
allLines - the lines of text to process.comparison - the comparison to make.searchTerm - the term to look for. Numerical Double object.currentIndexes - the list of current indexes to search from.java.lang.Exception - any error.