|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectextractTerms.LocalRule
Local rule used for improving relevancy of extraction. These rules are designed to be used on Occurrence object. The result of the application of these rules is true or false.
Grammar of the local rules language :
SOURCE -> E E -> F | not E | E and E | E or E F -> (UNIT, PART, STRING, STATUS, TYPE) UNIT -> 1 | 2 | 3 PART -> prefix | suffix | contain | tag | contain_regex | tag_regex STRING -> [^SEPARATOR]+ SEPARATOR -> '/' or any other character STATUS -> ACCEPTED | REJECTED TYPE - > any string
Occurrence
,
Serialized FormField Summary | |
static int |
ACCEPTED
Type of status |
static int |
AND
Binary operator. |
static int |
CONTAIN
Type of part. |
static int |
CONTAIN_REGEX
Type of part. |
static int |
NO_OPERATOR
Denote a rule with no operator. |
static int |
NOT
Unary operator. |
static int |
OR
Binary operator. |
static int |
PREFIX
Type of part. |
static int |
REJECTED
Type of status |
static int |
SUFFIX
Type of part. |
static int |
TAG
Type of part. |
static int |
TAG_REGEX
Type of part. |
Constructor Summary | |
LocalRule(int _operator,
LocalRule _nestedRule1,
LocalRule _nestedRule2)
Local rule constructor for the operators NOT, AND and OR which don't need to have filled all the fields of the object. |
|
LocalRule(int _operator,
LocalRule _nestedRule1,
LocalRule _nestedRule2,
int _unit,
int _part,
java.lang.String _string,
char _separator,
int _status,
java.lang.String _type)
Creates a new instance of LocalRule. |
Method Summary | |
boolean |
apply(Occurrence occ)
Returns true if the rule apply to the Occurrence. |
LocalRule |
getNestedRule1()
Returns the first nested local rule of this rule. |
LocalRule |
getNestedRule2()
Returns the secaond nested local rule of this rule. |
int |
getOperator()
Returns the operator of the rule. |
int |
getPart()
Returns the type of part that define how the rule is applied. |
int |
getSeparator()
Returns the separator of the unit. |
int |
getStatus()
Returns the status of the rule. |
java.lang.String |
getString()
Returns the string to use with part of the rule. |
java.lang.String |
getType()
Returns the type of the rule. |
int |
getUnit()
Returns the number of the unit where the rule is applied. |
java.lang.String |
toString()
Returns the string representation of a LocalRule. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int NO_OPERATOR
public static final int NOT
public static final int OR
public static final int AND
public static final int PREFIX
public static final int SUFFIX
public static final int CONTAIN
public static final int TAG
public static final int CONTAIN_REGEX
public static final int TAG_REGEX
public static final int ACCEPTED
public static final int REJECTED
Constructor Detail |
public LocalRule(int _operator, LocalRule _nestedRule1, LocalRule _nestedRule2)
full constructor
public LocalRule(int _operator, LocalRule _nestedRule1, LocalRule _nestedRule2, int _unit, int _part, java.lang.String _string, char _separator, int _status, java.lang.String _type)
_operator
- AND, OR, NOT or NO_OPERATOR if this is the last
operand of the rule._nestedRule1
- a nested LocalRule with AND, OR, NOT operator._nestedRule2
- a nested LocalRule with AND, OR operator._unit
- unit of application of the rule. 1, 2 or 3 only if
units triple._part
- part of application of the rule. PREFIX, SUFFIX,
CONTAIN or TAG..._string
- string to use with part of the rule to test the
Occurrence. Invariant : musn't contains SEPARATOR char._separator
- used to split unit in word and tag._status
- ACCEPTED or REJECTED status of the result of the rule_type
- type of the Occurrence objects selected by the ruleMethod Detail |
public int getUnit()
public int getPart()
public java.lang.String getString()
public int getSeparator()
public int getStatus()
public java.lang.String getType()
public int getOperator()
public LocalRule getNestedRule1()
public LocalRule getNestedRule2()
public boolean apply(Occurrence occ)
occ
- Occurrence onto apply rules
public java.lang.String toString()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |