Package ca.phon.fsa
Class FSAState<T>
java.lang.Object
ca.phon.fsa.FSAState<T>
- Type Parameters:
T
-
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionT[]
getGroup
(int grpIdx) Get the indicated group.int[]
Get group lenthsint[]
Get group startsint
int
T[]
T[]
getTape()
int
void
incrementGroup
(int groupIndex) Increment the length of the specified groupvoid
markGroup
(int groupIndex, int matchLength) Sets the given group start index to the current tape index and the group lenth to 1.int
The number of groupsvoid
Reset group start and length data.void
setCurrentState
(String currentState) void
setGroups
(int[] groupStarts, int[] groupLengths) Set group informationvoid
setLookAheadOffset
(int lookAheadOffset) void
setLookBehindOffset
(int lookBehindOffset) void
setRunningState
(FSAState.RunningState runningState) void
void
setTapeIndex
(int tapeIndex)
-
Constructor Details
-
FSAState
public FSAState()Constructor
-
-
Method Details
-
getCurrentState
-
setCurrentState
-
getRunningState
-
setRunningState
-
getTape
-
setTape
-
getTapeIndex
public int getTapeIndex() -
setTapeIndex
public void setTapeIndex(int tapeIndex) -
getLookAheadOffset
public int getLookAheadOffset() -
setLookAheadOffset
public void setLookAheadOffset(int lookAheadOffset) -
getLookBehindOffset
public int getLookBehindOffset() -
setLookBehindOffset
public void setLookBehindOffset(int lookBehindOffset) -
getMatchedTape
-
getGroup
Get the indicated group.- Parameters:
groupIdx
-- Returns:
- the matched contents
for the group or
null
if not found
-
markGroup
public void markGroup(int groupIndex, int matchLength) Sets the given group start index to the current tape index and the group lenth to 1.- Parameters:
groupIndex
-
-
incrementGroup
public void incrementGroup(int groupIndex) Increment the length of the specified group- Parameters:
groupIndex
-
-
setGroups
public void setGroups(int[] groupStarts, int[] groupLengths) Set group information- Parameters:
groupStarts
-groupLengths
-- Throws:
IllegalArgumentException
- if the given arrays are not of the same length
-
getGroupStarts
public int[] getGroupStarts()Get group starts- Returns:
- array of group starts
-
getGroupLengths
public int[] getGroupLengths()Get group lenths- Returns:
- array of group lengths
-
resetGroupData
public void resetGroupData()Reset group start and length data. -
numberOfGroups
public int numberOfGroups()The number of groups- Returns:
- number of groups
-