public abstract class NfaStateMultiTermPattern extends NfaState
Modifier and Type | Field and Description |
---|---|
protected String |
luceneField
What annotation we're trying to match
|
protected NfaState |
nextState
The next state if a matching token was found.
|
protected String |
pattern
The pattern this state accepts.
|
Constructor and Description |
---|
NfaStateMultiTermPattern(String luceneField,
String pattern,
NfaState nextState) |
Modifier and Type | Method and Description |
---|---|
protected String |
dumpInternal(Map<NfaState,Integer> stateNrs) |
boolean |
findMatchesInternal(ForwardIndexDocument fiDoc,
int pos,
int direction,
Set<Integer> matchEnds)
Find all matches for this NFA in the token source.
|
protected void |
finishInternal(Set<NfaState> visited)
Visit each node and replace dangling arrows (nulls) with the match state.
|
boolean |
hitsAllSameLength(Set<NfaState> statesVisited)
Are all hits from this NFA the same length?
|
int |
hitsLengthMax(Set<NfaState> statesVisited)
What's the maximum hit length?
|
int |
hitsLengthMin(Set<NfaState> statesVisited)
What's the minimum hit length?
|
void |
lookupPropertyNumbersInternal(ForwardIndexAccessor fiAccessor,
Map<NfaState,Boolean> statesVisited) |
boolean |
matchesEmptySequence(Set<NfaState> statesVisited)
Does this NFA match the empty sequence?
|
void |
setNextState(int i,
NfaState state)
Set the next state for a given input.
|
protected String luceneField
protected String pattern
protected NfaState nextState
public boolean findMatchesInternal(ForwardIndexDocument fiDoc, int pos, int direction, Set<Integer> matchEnds)
fiDoc
- where to read tokens frompos
- current matching positionmatchEnds
- where to collect the matches found, or null if we don't want
to collect themdirection
- matching directionpublic void setNextState(int i, NfaState state)
NfaState
setNextState
in class NfaState
i
- inputstate
- next statepublic boolean matchesEmptySequence(Set<NfaState> statesVisited)
NfaState
matchesEmptySequence
in class NfaState
statesVisited
- states we've already visited, so we can deal with cyclespublic boolean hitsAllSameLength(Set<NfaState> statesVisited)
NfaState
hitsAllSameLength
in class NfaState
statesVisited
- states we've already visited, so we can deal with cyclespublic int hitsLengthMin(Set<NfaState> statesVisited)
NfaState
hitsLengthMin
in class NfaState
statesVisited
- states we've already visited, so we can deal with cyclespublic int hitsLengthMax(Set<NfaState> statesVisited)
NfaState
hitsLengthMax
in class NfaState
statesVisited
- states we've already visited, so we can deal with cyclesprotected String dumpInternal(Map<NfaState,Integer> stateNrs)
dumpInternal
in class NfaState
public void lookupPropertyNumbersInternal(ForwardIndexAccessor fiAccessor, Map<NfaState,Boolean> statesVisited)
protected void finishInternal(Set<NfaState> visited)
NfaState
finishInternal
in class NfaState
visited
- nodes visited so far, this one included. finish() uses this to
make sure we don't visit the same node twice, so always call
finish() in your implementations, not finishInternal().Copyright © 2020 Instituut voor Nederlandse Taal (INT). All rights reserved.