|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgate.jape.Transducer
gate.jape.Rule
A CPSL rule. Has an LHS, RHS and a name, and a priority.
Field Summary | |
private static boolean |
DEBUG
Debug flag |
private LeftHandSide |
lhs
The LHS or pattern of the rule. |
private int |
pendingPosition
If we matched but didn't fire yet, this is our pending position. |
private int |
position
The rule's position in sequence (e.g. |
private int |
priority
The priority of the rule. |
private RightHandSide |
rhs
The RHS or action of the rule. |
private boolean |
weFinished
Flag for end of document during getNextMatch. |
Fields inherited from class gate.jape.Transducer |
interrupted, name, ontology |
Fields inherited from interface gate.jape.JapeConstants |
APPELT_STYLE, BRILL_STYLE, DEFAULT_PRIORITY, FIRST_STYLE, INDENT_PADDING, KLEENE_PLUS, KLEENE_QUERY, KLEENE_STAR, MULTI_SPAN_BINDING, NO_BINDING, NO_KLEENE_OP, ONCE_STYLE, SINGLE_SPAN_BINDING |
Constructor Summary | |
Rule(String name,
int position,
int priority,
LeftHandSide lhs,
RightHandSide rhs)
Construction |
Method Summary | |
void |
addProcessProgressListener(ProgressListener listener)
|
void |
addStatusListener(StatusListener listener)
|
void |
cleanUp()
Clean up (delete action class files, for e.g.). |
void |
finish()
Finish: replace dynamic data structures with Java arrays; called after parsing. |
boolean |
finished()
Have we hit the end of the document without matching? |
int |
getEndPosition()
Return the ending position of a match. |
LeftHandSide |
getLHS()
|
int |
getNextMatch(Document doc,
int position,
int end)
If another match at or beyond position is possible return
the position we want to fire in, else -1. |
int |
getPosition()
Get the rule's position in sequence (e.g. |
int |
getPriority()
Get the rule priority. |
RightHandSide |
getRHS()
|
int |
getStartPosition()
Return the starting position of a match. |
boolean |
matches(Document doc,
int position,
MutableInteger newPosition)
Does this element match the document at this position? |
int |
pending()
If we're pending (have matched), get the position we want to fire in, else -1. |
void |
removeProcessProgressListener(ProgressListener listener)
|
void |
removeStatusListener(StatusListener listener)
|
void |
reset()
Clear away the results of a match. |
String |
toString()
Create a string representation of the object. |
String |
toString(String pad)
Create a string representation of the object. |
void |
transduce(Document doc,
AnnotationSet inputAS,
AnnotationSet outputAS)
Apply the RHS of this rule (LHS must have been matched first). |
Methods inherited from class gate.jape.Transducer |
addProgressListener, fireProcessFinished, fireProgressChanged, fireStatusChanged, getBaseURL, getName, getOntology, interrupt, isDebugMode, isInterrupted, removeProgressListener, setBaseURL, setDebugMode, setOntology |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private static final boolean DEBUG
private LeftHandSide lhs
private RightHandSide rhs
private int priority
private int position
private int pendingPosition
private boolean weFinished
Constructor Detail |
public Rule(String name, int position, int priority, LeftHandSide lhs, RightHandSide rhs)
Method Detail |
public int getPriority()
public int getPosition()
public int pending()
public boolean finished()
public void finish()
finish
in class Transducer
public int getNextMatch(Document doc, int position, int end)
position
is possible return
the position we want to fire in, else -1.
public int getEndPosition()
public int getStartPosition()
public boolean matches(Document doc, int position, MutableInteger newPosition)
public void transduce(Document doc, AnnotationSet inputAS, AnnotationSet outputAS) throws JapeException
transduce
in class Transducer
JapeException
public void reset()
public void cleanUp()
cleanUp
in class Transducer
public String toString()
public String toString(String pad)
toString
in class Transducer
public LeftHandSide getLHS()
public RightHandSide getRHS()
public void addStatusListener(StatusListener listener)
addStatusListener
in class Transducer
public void removeStatusListener(StatusListener listener)
removeStatusListener
in class Transducer
public void addProcessProgressListener(ProgressListener listener)
public void removeProcessProgressListener(ProgressListener listener)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |