|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.northwestern.at.wordhoard.swing.calculator.cql.CQLTerm
public class CQLTerm
A WordHoard Corpus Query Language term.
The general form of a query term is:
[!]func({text})
!means "do not match the text defined by this term." By default, the text will be matched.
func is the term type. Example: spe means spelling.
text is the term text. If enclosed in braces, it is assumed to be a regular expression. The term text need not be enclosed in quotes unless it contains blanks or special characters.
Examples:
Field Summary | |
---|---|
protected static java.util.HashMap |
allowsOperators
True if element value can contain operator. |
static int |
AUTHORCONTEMPORARY
|
static int |
AUTHORNAME
|
static int |
CORPUSTAG
|
static int |
CORPUSTITLE
|
protected static java.util.HashMap |
elementsToHQLNames
Maps term types to HQL names. |
protected static java.util.HashMap |
elementsToNames
Maps term types to CQL names. |
protected static java.lang.String |
gender_female
|
protected static java.lang.String |
gender_male
Object model data values. |
protected static java.lang.String |
gender_uncertain
|
protected boolean |
isRegExp
True if query text is a regular expression. |
static int |
ISVERSE
|
static int |
LEMMA
|
static int |
MAJORWORDCLASS
|
protected boolean |
matchTerm
True to match the query text, false to not match it. |
static int |
METRICALSHAPE
|
protected static java.lang.String |
mortality_immortal
|
protected static java.lang.String |
mortality_mortal
|
protected static java.lang.String |
mortality_uncertain
|
protected static java.util.HashMap |
namesToElements
Maps CQL names to term types. |
static int |
NARRATIVE
|
static int |
POS
|
protected static java.lang.String |
prosodic_prose
|
protected static java.lang.String |
prosodic_unknown
|
protected static java.lang.String |
prosodic_verse
|
static int |
PUBLICATIONYEAREARLY
|
static int |
PUBLICATIONYEARLATE
|
static int |
SEMANTICTAGS
|
static int |
SPEAKER
|
static int |
SPEAKERGENDER
|
static int |
SPEAKERMORTALITY
|
static int |
SPELLING
The query term types. |
protected java.lang.String |
termText
The query term text. |
protected int |
termType
The type of query term. |
static int |
WORDCLASS
|
static int |
WORDPARTCOUNT
|
static int |
WORKFULLTITLE
|
static int |
WORKPARTFULLTITLE
|
static int |
WORKPARTSHORTTITLE
|
static int |
WORKPARTTAG
|
static int |
WORKSHORTTITLE
|
static int |
WORKTAG
|
Constructor Summary | |
---|---|
CQLTerm()
Create new term type. |
|
CQLTerm(CQLQueryTokenizer tokenizer)
Create a new term type from a CQLQueryTokenizer. |
|
CQLTerm(java.lang.String termText,
int termType,
boolean matchTerm,
boolean isRegExp)
Create a new term type. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object other)
Check if this query term is equal to another. |
protected java.lang.String |
getTermTypeName(int termType)
Get term type name. |
boolean |
hasAuthor()
Determine if query term refers to an author. |
int |
hashCode()
Hash code for query term. |
boolean |
hasSpeaker()
Determine if query term refers to a speaker. |
boolean |
hasSpeech()
Determine if query term refers to a speech. |
boolean |
hasWordPart()
Determine if query term refers to a word part. |
boolean |
hasWork()
Determine if query term refers to a work. |
boolean |
hasWorkPart()
Determine if query term refers to a work part. |
java.lang.String |
toHQL(java.lang.String queryField,
int fieldIndex,
boolean doingWords)
Get HQL version of query term. |
java.lang.String |
toString()
Get string version of query term for display. |
protected void |
validateTermText(CQLQueryTokenizer tokenizer)
Fix up query arguments as needed to match database values. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SPELLING
public static final int LEMMA
public static final int POS
public static final int WORDCLASS
public static final int MAJORWORDCLASS
public static final int SPEAKER
public static final int SPEAKERGENDER
public static final int SEMANTICTAGS
public static final int ISVERSE
public static final int METRICALSHAPE
public static final int SPEAKERMORTALITY
public static final int WORDPARTCOUNT
public static final int AUTHORNAME
public static final int AUTHORCONTEMPORARY
public static final int CORPUSTAG
public static final int CORPUSTITLE
public static final int WORKFULLTITLE
public static final int WORKSHORTTITLE
public static final int WORKTAG
public static final int WORKPARTFULLTITLE
public static final int WORKPARTSHORTTITLE
public static final int WORKPARTTAG
public static final int PUBLICATIONYEAREARLY
public static final int PUBLICATIONYEARLATE
public static final int NARRATIVE
protected java.lang.String termText
protected int termType
protected boolean matchTerm
protected boolean isRegExp
protected static final java.util.HashMap elementsToNames
protected static final java.util.HashMap elementsToHQLNames
protected static final java.util.HashMap namesToElements
protected static final java.util.HashMap allowsOperators
protected static java.lang.String gender_male
protected static java.lang.String gender_female
protected static java.lang.String gender_uncertain
protected static java.lang.String mortality_mortal
protected static java.lang.String mortality_immortal
protected static java.lang.String mortality_uncertain
protected static java.lang.String prosodic_prose
protected static java.lang.String prosodic_verse
protected static java.lang.String prosodic_unknown
Constructor Detail |
---|
public CQLTerm()
public CQLTerm(java.lang.String termText, int termType, boolean matchTerm, boolean isRegExp)
termText
- The query term text.termType
- The query term type.matchTerm
- True to match term, false to not match.isRegExp
- True if term text is regular expression. public CQLTerm(CQLQueryTokenizer tokenizer) throws InvalidCQLQueryException
tokenizer
- The CQLQueryTokenizer. Should be pointing
at the start of a CQLTerm definition.
InvalidCQLQueryException
- if the CQL term syntax is bad. Method Detail |
---|
protected void validateTermText(CQLQueryTokenizer tokenizer)
tokenizer
- CQLQueryTokenizer.
InvalidCQLQueryException
- if the CQL term syntax is bad. protected java.lang.String getTermTypeName(int termType)
termType
- The term type.
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toHQL(java.lang.String queryField, int fieldIndex, boolean doingWords)
queryField
- The name of field to which this query term applies.fieldIndex
- The index of this field in the select clause.doingWords
- true if word results, false for work part results.
public boolean hasAuthor()
public boolean hasSpeaker()
public boolean hasSpeech()
public boolean hasWordPart()
public boolean hasWork()
public boolean hasWorkPart()
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
The query terms are equal when the term text, term type, match term, and is regular expression fields are the same in both query terms.
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |