3 instantiations of State
System.Speech (3)
Internal\SrgsCompiler\BackEnd.cs (2)
872var newState = new State(ruleCur, hNewState, k); 893var nextState = new State(ruleCur, hNewState, iNextArc);
Internal\SrgsCompiler\Graph.cs (1)
73State newState = new(rule, hNewState);
135 references to State
System.Speech (135)
Internal\SrgsCompiler\Arc.cs (8)
43internal Arc(Arc arc, State? start, State? end) 50internal Arc(Arc arc, State? start, State? end, int wordId) 614internal State? Start 631internal State? End 797private State? _start; 800private State? _end;
Internal\SrgsCompiler\BackEnd.cs (49)
57List<State> sortedStates = new(_states); 141foreach (State state in sortedStates) 156foreach (State state in sortedStates) 207Dictionary<State, State> srcToDestHash = new(); 220internal State CreateNewState(Rule rule) 225internal void DeleteState(State state) 230internal void MoveInputTransitionsAndDeleteState(State from, State to) 235internal void MoveOutputTransitionsAndDeleteState(State from, State to) 469internal State CloneSubGraph(State srcFromState, State srcEndState, State destFromState) 471Dictionary<State, State> SrcToDestHash = new(); // Hash source state to destination state 472Stack<State> CloneStack = new(); // States to process 490State? srcToState = arc.End; 491State? destToState = null; 526internal void CloneSubGraph(Rule rule, Backend org, Backend extra, Dictionary<State, State> srcToDestHash, bool fromOrg) 531List<State> CloneStack = new(); // States to process 540State srcFromState = CloneStack[0]; 542State destFromState = srcToDestHash[srcFromState]; 547State? srcToState = arc.End; 548State? destToState = null; 630internal void DeleteSubGraph(State state) 633Stack<State> stateToProcess = new(); // States to delete 635Collection<State> statesToDelete = new(); 650State? endState = arc.End; 666foreach (State stateToDelete in statesToDelete) 814State?[] apStateTable = new State[header.arcs.Length]; 831State? currentState = null; 872var newState = new State(ruleCur, hNewState, k); 885State? targetState = null; 893var nextState = new State(ruleCur, hNewState, iNextArc); 981private CfgGrammar.CfgSerializedHeader BuildHeader(List<State> sortedStates, int cBasePath, ushort iSemanticGlobals, out int cArcs, out float[]? pWeights) 989foreach (State state in sortedStates) 1089private CfgGrammar.CfgHeader BuildRulesFromBinaryGrammar(CfgGrammar.CfgHeader header, State?[] apStateTable, SortedDictionary<int, Rule> ruleFirstArcs, int previousCfgLastRules) 1146private Rule CloneState(State srcToState, List<State> CloneStack, Dictionary<State, State> srcToDestHash) 1165State newState = CreateNewState(dstRule); 1253private void CheckLeftRecursion(List<State> states) 1256foreach (State state in states) 1270internal void AddState(State state)
Internal\SrgsCompiler\Graph.cs (46)
19internal class Graph : IEnumerable<State> 23internal void Add(State state) 36internal void Remove(State state) 52for (State? item = _startState; item != null; item = item.Next) 58IEnumerator<State> IEnumerable<State>.GetEnumerator() 60for (State? item = _startState; item != null; item = item.Next) 69internal State CreateNewState(Rule rule) 73State newState = new(rule, hNewState); 84internal void DeleteState(State state) 98foreach (State state in this) 127foreach (State state in this) 168internal void MoveInputTransitionsAndDeleteState(State srcState, State? destState) 214internal void MoveOutputTransitionsAndDeleteState(State srcState, State? destState) 240internal State? First 253for (State? se = _startState; se != null; se = se.Next) 293for (State? state = First, nextState = null; state != null; state = nextState) 306State? pEpsilonStartState = epsilonArc.Start; 336State? pEpsilonEndState = epsilonArc.End; 371foreach (State state in this) 381Stack<State> mergeStates = new(); 387private void RecursiveMergeDuplicatedInputTransition(Stack<State> mergeStates) 390foreach (State state in this) 402State state = mergeStates.Pop(); 412private void RecursiveMergeDuplicatedOutputTransition(Stack<State> mergeStates) 415foreach (State state in this) 427State state = mergeStates.Pop(); 457private void MergeDuplicateInputTransitions(ArcList arcs, Stack<State> mergeStates) 502State? commonStartState = null; 526State? duplicatedStartState = duplicatedArc.Start; 599private void MergeDuplicateOutputTransitions(ArcList arcs, Stack<State> mergeStates) 644State? commonEndState = null; 668State duplicatedEndState = duplicatedArc.End!; 717private static void AddToMergeStateList(Stack<State> mergeStates, State commonEndState) 737State? startState = arc.Start; 772State endState = arc.End; 922private static void NormalizeTransitionWeights(State state) 957public State[] AKeys 961State[] states = new State[_states.Count]; 963foreach (State state in _states) 979private State? _startState; 980private State? _curState;
Internal\SrgsCompiler\Item.cs (7)
48State endState = _startArc.End; 64State? startState = _startArc.End; 75State? currentStartState = startState; 82State newStartState = _backend.CreateNewState(_endArc.Start.Rule); 85State newEndState = _backend.CloneSubGraph(currentStartState!, _endArc.Start, newStartState); 142private void AddEpsilonTransition(State? start, State? end, float weight)
Internal\SrgsCompiler\OneOf.cs (4)
72State? endStartState = end.Start; 73State? startEndState = start.End; 104private State _startState; 105private State _endState;
Internal\SrgsCompiler\ParseElementCollection.cs (7)
33State state = _backend.CreateNewState(_rule); 77State insertionState = _backend.CreateNewState(_rule); 102for (State? startState = startArc.End; startArc.IsEpsilonTransition && startState != null && Graph.MoveSemanticTagRight(startArc) && startState.InArcs.CountIsOne && startState.OutArcs.CountIsOne; startState = startArc.End) 135for (State? endState = endArc.Start; endArc.IsEpsilonTransition && endState != null && Graph.MoveSemanticTagLeft(endArc) && endState.InArcs.CountIsOne && endState.OutArcs.CountIsOne; endState = endArc.Start) 176State? state = null; 201State? from = _endArc.Start; 202State? to = start.End;
Internal\SrgsCompiler\Rule.cs (2)
245State? endState = endArc.Start; 274internal State? _firstState;
Internal\SrgsCompiler\State.cs (12)
19internal sealed class State : IComparable<State> 41int IComparable<State>.CompareTo(State? state2) 157internal State Add(State state) 171internal State? Next 179internal State? Prev 259State pRuleFirstNode = arc.RuleRef._firstState; 387private static int Compare(State state1, State state2) 489private State? _next; 490private State? _prev;