|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectElement
public class Element
A part of a pattern.
| Constructor Summary | |
|---|---|
Element(String token,
boolean caseSensitive,
boolean regExp,
boolean inflected)
|
|
| Method Summary | |
|---|---|
boolean |
checkAndGroup(boolean previousValue)
|
void |
compile(AnalyzedTokenReadings token,
Synthesizer synth)
Prepare Element for matching by formatting its string token and POS (if the Element is supposed to refer to some other token). |
ArrayList<Element> |
getAndGroup()
Returns the group of elements linked with AND operator. |
boolean |
getCaseSensitive()
Whether the element matches case sensitively. |
Match |
getMatch()
|
boolean |
getNegation()
see setNegation(boolean) |
String |
getPhraseName()
Gets the phrase the element is in. |
int |
getSkipNext()
Gets the exception scope length. |
String |
getString()
|
boolean |
hasAndGroup()
Checks if this element has an AND group associated with it. |
boolean |
hasPreviousException()
Checks if the element has an exception for a previous token. |
boolean |
isAndExceptionGroupMatched(AnalyzedToken token)
Enables testing multiple conditions specified by multiple element exceptions. |
boolean |
isAndGroupMatched(AnalyzedToken token)
Enables testing multiple conditions specified by different elements. |
boolean |
isExceptionMatched(AnalyzedToken token)
Checks whether an exception matches. |
boolean |
isExceptionMatchedCompletely(AnalyzedToken token)
This method checks exceptions both in AND-group and the token. |
boolean |
isMatched(AnalyzedToken token)
Checks whether the rule element matches the token given as a parameter. |
boolean |
isMatchedByScopeNextException(AnalyzedToken token)
Checks whether a previously set exception matches (in case the exception had scope == "next"). |
boolean |
isMatchedByScopePreviousException(AnalyzedToken token)
Checks whether an exception for a previous token matches (in case the exception had scope == "previous"). |
boolean |
isMatchedCompletely(AnalyzedToken token)
This method checks AND-group and the token. |
boolean |
isPartOfPhrase()
Checks if the Element is in any phrase. |
boolean |
isReferenceElement()
|
boolean |
isSentStart()
Checks if the token is a SENT_START. |
void |
setAndGroupElement(Element andToken)
|
void |
setMatch(Match match)
Sets the reference to another token. |
void |
setNegation(boolean negation)
Negates the meaning of match(). |
void |
setPhraseName(String s)
Sets the phrase the element is in. |
void |
setPosElement(String posToken,
boolean regExp,
boolean negation)
|
void |
setPosException(String posToken,
boolean regExp,
boolean negation,
boolean scopeNext,
boolean scopePrevious)
Sets a POS-type exception for matching string tokens. |
void |
setSkipNext(int i)
Sets the exception scope length. |
void |
setStringElement(String token)
|
void |
setStringException(String token,
boolean regExp,
boolean inflected,
boolean negation,
boolean scopeNext,
boolean scopePrevious)
Sets a string-type exception for matching string tokens. |
void |
setupAndGroup()
|
String |
toString()
|
| Methods inherited from class Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Element(String token,
boolean caseSensitive,
boolean regExp,
boolean inflected)
| Method Detail |
|---|
public final boolean isMatched(AnalyzedToken token)
token - @AnalyzedToken to check matching against
public final boolean isExceptionMatched(AnalyzedToken token)
token - @AnalyzedToken to check matching against
public final boolean isAndGroupMatched(AnalyzedToken token)
setupAndGroup(), and followed by checkAndGroup(boolean).
token - AnalyzedToken - the token checked.
public final void setupAndGroup()
public final boolean checkAndGroup(boolean previousValue)
public final boolean isMatchedCompletely(AnalyzedToken token)
token - Token to match
public final boolean isAndExceptionGroupMatched(AnalyzedToken token)
token - AnalyzedToken - the token checked for exceptions.
public final boolean isExceptionMatchedCompletely(AnalyzedToken token)
token - Token to match
public final void setAndGroupElement(Element andToken)
public final boolean hasAndGroup()
public final ArrayList<Element> getAndGroup()
public final boolean isMatchedByScopeNextException(AnalyzedToken token)
token - @AnalyzedToken to check matching against.
public final boolean isMatchedByScopePreviousException(AnalyzedToken token)
token - @AnalyzedToken to check matching against.
public final boolean isSentStart()
public final String toString()
toString in class Object
public final void setPosElement(String posToken,
boolean regExp,
boolean negation)
public final String getString()
public final void setStringElement(String token)
public final void setPosException(String posToken,
boolean regExp,
boolean negation,
boolean scopeNext,
boolean scopePrevious)
posToken - The part of the speech tag in the exception.regExp - True if the POS is specified as a regular
expression.negation - True if the exception is negated.scopeNext - True if the exception scope is next tokens.scopePrevious - True if the exception should match only a single
previous token.
public final void setStringException(String token,
boolean regExp,
boolean inflected,
boolean negation,
boolean scopeNext,
boolean scopePrevious)
token - The string in the exception.regExp - True if the string is specified as a regular
expression.inflected - True if the string is a base form (lemma).negation - True if the exception is negated.scopeNext - True if the exception scope is next tokens.scopePrevious - True if the exception should match only a single
previous token.public final int getSkipNext()
public final void setSkipNext(int i)
i - @int Exception scope length.public final boolean hasPreviousException()
public final void setNegation(boolean negation)
negation - - true if the meaning of match()
is to be negated.public final boolean getNegation()
setNegation(boolean)
public final boolean isReferenceElement()
public final void setMatch(Match match)
match - Formatting object for the token reference.public final Match getMatch()
public final void compile(AnalyzedTokenReadings token,
Synthesizer synth)
token - @AnalyzedTokenReadings - the token
synth @Syntesizer - the language synthesizerpublic final void setPhraseName(String s)
s - ID of the phrase.public final boolean isPartOfPhrase()
public final boolean getCaseSensitive()
public final String getPhraseName()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||