Class FSAState<T>
java.lang.Object
ca.phon.fsa.FSAState<T>
- Type Parameters:
T-
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionT[]getGroup(int grpIdx) Get the indicated group.int[]Get group lenthsint[]Get group startsintintT[]T[]getTape()intvoidincrementGroup(int groupIndex) Increment the length of the specified groupvoidmarkGroup(int groupIndex, int matchLength) Sets the given group start index to the current tape index and the group lenth to 1.intThe number of groupsvoidReset group start and length data.voidsetCurrentState(String currentState) voidsetGroups(int[] groupStarts, int[] groupLengths) Set group informationvoidsetLookAheadOffset(int lookAheadOffset) voidsetLookBehindOffset(int lookBehindOffset) voidsetRunningState(FSAState.RunningState runningState) voidvoidsetTapeIndex(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
nullif 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
-