public final class GraphTokenStreamFiniteStrings
extends java.lang.Object
Automaton
where the transition labels are terms from
the TermToBytesRefAttribute
.
This class also provides helpers to explore the different paths of the Automaton
.Modifier and Type | Class and Description |
---|---|
private class |
GraphTokenStreamFiniteStrings.FiniteStringsTokenStream |
Modifier and Type | Field and Description |
---|---|
private Automaton |
det |
private AttributeSource[] |
tokens |
private Transition |
transition |
Constructor and Description |
---|
GraphTokenStreamFiniteStrings(TokenStream in) |
Modifier and Type | Method and Description |
---|---|
int[] |
articulationPoints()
Returns the articulation points (or cut vertices) of the graph:
https://en.wikipedia.org/wiki/Biconnected_component
|
private static void |
articulationPointsRecurse(Automaton a,
int state,
int d,
int[] depth,
int[] low,
int[] parent,
java.util.BitSet visited,
java.util.List<java.lang.Integer> points) |
private Automaton |
build(TokenStream in)
Build an automaton from the provided
TokenStream . |
java.util.Iterator<TokenStream> |
getFiniteStrings()
Get all finite strings from the automaton.
|
java.util.Iterator<TokenStream> |
getFiniteStrings(int startState,
int endState)
Get all finite strings that start at
startState and end at endState . |
java.util.List<AttributeSource> |
getTerms(int state)
Returns the list of tokens that start at the provided state
|
Term[] |
getTerms(java.lang.String field,
int state)
Returns the list of terms that start at the provided state
|
boolean |
hasSidePath(int state)
Returns whether the provided state is the start of multiple side paths of different length (eg: new york, ny)
|
private AttributeSource[] tokens
private final Automaton det
private final Transition transition
public GraphTokenStreamFiniteStrings(TokenStream in) throws java.io.IOException
java.io.IOException
public boolean hasSidePath(int state)
public java.util.List<AttributeSource> getTerms(int state)
public Term[] getTerms(java.lang.String field, int state)
public java.util.Iterator<TokenStream> getFiniteStrings() throws java.io.IOException
java.io.IOException
public java.util.Iterator<TokenStream> getFiniteStrings(int startState, int endState)
startState
and end at endState
.public int[] articulationPoints()
private Automaton build(TokenStream in) throws java.io.IOException
TokenStream
.java.io.IOException
private static void articulationPointsRecurse(Automaton a, int state, int d, int[] depth, int[] low, int[] parent, java.util.BitSet visited, java.util.List<java.lang.Integer> points)