7 instantiations of Arc
System.Speech (7)
Internal\SrgsCompiler\BackEnd.cs (7)
385
return new
Arc
(text, null, _words, 1.0f, CfgGrammar.SP_NORMAL_CONFIDENCE, null, matchMode, ref _fNeedWeightTable);
419
Arc arc =
new
(null, ruleToTransitionTo, _words, flWeight, '\0', specialRuleTrans, MatchMode.AllWords, ref fNeedWeightTable);
506
Arc newArc =
new
(arc, destFromState, destToState);
568
Arc newArc =
new
(arc, destFromState, destToState, newWordId);
908
newArc = new
Arc
(null, ruleToTransitionTo, _words!, flWeight, CfgGrammar.SP_NORMAL_CONFIDENCE, null, MatchMode.AllWords, ref _fNeedWeightTable);
914
newArc = new
Arc
((ulSpecialTransitionIndex != 0) ? 0 : (int)arc.TransitionIndex, flWeight, arc.LowConfRequired ? CfgGrammar.SP_LOW_CONFIDENCE : arc.HighConfRequired ? CfgGrammar.SP_HIGH_CONFIDENCE : CfgGrammar.SP_NORMAL_CONFIDENCE, ulSpecialTransitionIndex, MatchMode.AllWords, ref _fNeedWeightTable);
1265
Arc arc =
new
(s, null, _words, flWeight, requiredConfidence, null, MatchMode.AllWords, ref _fNeedWeightTable);
176 references to Arc
System.Speech (176)
Internal\SrgsCompiler\Arc.cs (30)
17
internal class Arc : IComparer<
Arc
>, IComparable<
Arc
>
25
internal Arc(
Arc
arc)
43
internal Arc(
Arc
arc, State? start, State? end)
50
internal Arc(
Arc
arc, State? start, State? end, int wordId)
103
public int CompareTo(
Arc
? obj1)
108
int IComparer<
Arc
>.Compare(
Arc
? obj1,
Arc
? obj2)
113
private int Compare(
Arc
? obj1,
Arc
? obj2)
124
Arc
arc1 = obj1;
125
Arc
arc2 = obj2;
133
internal static int CompareContent(
Arc
arc1,
Arc
arc2)
172
internal static int CompareContentForKey(
Arc
arc1,
Arc
arc2)
224
internal static float SerializeExtraEpsilonWithTag(StreamMarshaler streamBuffer,
Arc
arc, bool isLast, uint arcIndex)
267
internal static int CompareForDuplicateInputTransitions(
Arc
arc1,
Arc
arc2)
269
int iContentCompare =
Arc
.CompareContent(arc1, arc2);
284
internal static int CompareForDuplicateOutputTransitions(
Arc
arc1,
Arc
arc2)
287
int iContentCompare =
Arc
.CompareContent(arc1, arc2);
301
internal static int CompareIdenticalTransitions(
Arc
arc1,
Arc
arc2)
335
internal static void CopyTags(
Arc
src,
Arc
dest, Direction move)
397
internal void CloneTags(
Arc
arc, List<Tag> _tags, Dictionary<Tag, Tag> endArcs, Backend? be)
437
internal bool SameTags(
Arc
arc)
Internal\SrgsCompiler\ArcList.cs (13)
20
internal List<
Arc
> ToList()
22
List<
Arc
> collection = new();
23
foreach (
Arc
arc in this)
32
return
Arc
.CompareContentForKey((
Arc
)arc1, (
Arc
)arc2);
39
internal new
Arc
First
43
return (
Arc
)base.First;
57
foreach (
Arc
arc in this)
73
public
Arc
[] AKeys
77
Arc
[] item = new
Arc
[_item.Count];
79
foreach (
Arc
arc in _item)
Internal\SrgsCompiler\BackEnd.cs (22)
375
internal
Arc
WordTransition(string sWord, float flWeight, int requiredConfidence)
380
internal
Arc
SubsetTransition(string text, MatchMode matchMode)
398
internal
Arc
RuleTransition(Rule rule, Rule? parentRule, float flWeight)
419
Arc
arc = new(null, ruleToTransitionTo, _words, flWeight, '\0', specialRuleTrans, MatchMode.AllWords, ref fNeedWeightTable);
439
internal
Arc
EpsilonTransition(float flWeight)
444
internal void AddSemanticInterpretationTag(
Arc
arc, CfgGrammar.CfgProperty propertyInfo)
454
internal void AddPropertyTag(
Arc
start,
Arc
end, CfgGrammar.CfgProperty propertyInfo)
487
foreach (
Arc
arc in srcFromState.OutArcs)
506
Arc
newArc = new(arc, destFromState, destToState);
544
foreach (
Arc
arc in srcFromState.OutArcs)
568
Arc
newArc = new(arc, destFromState, destToState, newWordId);
634
Collection<
Arc
> arcsToDelete = new();
647
foreach (
Arc
arc in state.OutArcs)
660
foreach (
Arc
arc in arcsToDelete)
828
Arc
[] apArcTable = new
Arc
[header.arcs.Length];
884
Arc
newArc;
975
private
Arc
CreateTransition(string? sWord, float flWeight, int requiredConfidence)
1204
void AddArc(
Arc
arc)
1262
private
Arc
AddSingleWordTransition(string? s, float flWeight, int requiredConfidence)
1265
Arc
arc = new(s, null, _words, flWeight, requiredConfidence, null, MatchMode.AllWords, ref _fNeedWeightTable);
Internal\SrgsCompiler\Graph.cs (64)
132
foreach (
Arc
arc in state.OutArcs)
174
List<
Arc
> arcs = srcState.InArcs.ToList();
175
foreach (
Arc
arc in arcs)
221
List<
Arc
> arcs = srcState.OutArcs.ToList();
222
foreach (
Arc
arc in arcs)
299
Arc
epsilonArc = state.InArcs.First;
312
foreach (
Arc
arc in state.OutArcs)
328
Arc
epsilonArc = state.OutArcs.First;
368
List<
Arc
> tempList = new();
399
List<
Arc
> tempList = new();
424
List<
Arc
> tempList = new();
459
List<
Arc
>? arcsToMerge = null;
462
Arc
? refArc = null;
466
foreach (
Arc
arc in arcs)
471
if (refArc != null &&
Arc
.CompareContent(arc, refArc) == 0)
476
arcsToMerge ??= new List<
Arc
>();
498
arcsToMerge.Sort(
Arc
.CompareForDuplicateInputTransitions);
501
Arc
? commonArc = null; // Common property-less transition to merge into
505
foreach (
Arc
arc in arcsToMerge)
507
if (refArc == null ||
Arc
.CompareContent(arc, refArc) != 0)
525
Arc
duplicatedArc = arc;
540
foreach (
Arc
arcOut in commonStartState!.OutArcs)
549
foreach (
Arc
arcOut in duplicatedStartState!.OutArcs)
555
Arc
.CopyTags(commonArc, duplicatedArc, Direction.Left);
601
List<
Arc
>? arcsToMerge = null;
604
Arc
? refArc = null;
608
foreach (
Arc
arc in arcs)
613
if (refArc != null &&
Arc
.CompareContent(arc, refArc) == 0)
618
arcsToMerge ??= new List<
Arc
>();
640
arcsToMerge.Sort(
Arc
.CompareForDuplicateOutputTransitions);
643
Arc
? commonArc = null; // Common property-less transition to merge into
647
foreach (
Arc
arc in arcsToMerge)
649
if (refArc == null ||
Arc
.CompareContent(arc, refArc) != 0)
667
Arc
duplicatedArc = arc;
682
foreach (
Arc
arcOut in commonEndState!.OutArcs)
691
foreach (
Arc
arcOut in duplicatedEndState.OutArcs)
697
Arc
.CopyTags(commonArc, duplicatedArc, Direction.Right);
734
internal static bool MoveSemanticTagLeft(
Arc
arc)
744
Arc
previousArc = startState.InArcs.First;
748
Arc
.CopyTags(arc, previousArc, Direction.Left);
768
internal static bool MoveSemanticTagRight(
Arc
arc)
778
Arc
pNextArc = endState.OutArcs.First;
782
Arc
.CopyTags(arc, pNextArc, Direction.Right);
796
internal static bool CanTagsBeMoved(
Arc
start,
Arc
end)
810
private static void DeleteTransition(
Arc
arc)
827
private static void MergeIdenticalTransitions(ArcList arcs, List<
Arc
> identicalWords)
833
List<List<
Arc
>>? segmentsToDelete = null;
834
Arc
refArc = arcs.First;
837
foreach (
Arc
arc in arcs)
839
if (
Arc
.CompareContent(refArc, arc) != 0)
844
identicalWords.Sort(
Arc
.CompareIdenticalTransitions);
845
segmentsToDelete ??= new List<List<
Arc
>>();
850
segmentsToDelete.Add(new List<
Arc
>(identicalWords));
868
foreach (List<
Arc
> segmentToDelete in segmentsToDelete)
892
private static void MergeIdenticalTransitions(List<
Arc
> identicalWords)
894
Collection<
Arc
>? arcsToDelete = null;
895
Arc
? refArc = null;
896
foreach (
Arc
arc in identicalWords)
898
if (refArc != null &&
Arc
.CompareIdenticalTransitions(refArc, arc) == 0)
904
arcsToDelete ??= new Collection<
Arc
>();
911
foreach (
Arc
arc in arcsToDelete)
927
foreach (
Arc
arc in state.OutArcs)
937
foreach (
Arc
arc in state.OutArcs)
Internal\SrgsCompiler\Item.cs (2)
92
System.Diagnostics.Debug.Assert(newEndState.OutArcs.CountIsOne &&
Arc
.CompareContent(_endArc, newEndState.OutArcs.First) == 0);
144
Arc
epsilon = _backend.EpsilonTransition(weight);
Internal\SrgsCompiler\OneOf.cs (2)
67
internal override void AddArc(
Arc
start,
Arc
end)
Internal\SrgsCompiler\ParseElementCollection.cs (20)
29
Arc
tagTransition = _backend.EpsilonTransition(1.0f);
58
protected
Arc
InsertState(
Arc
arc, float weight, Position position)
74
Arc
epsilon = _backend.EpsilonTransition(weight);
95
protected static
Arc
TrimStart(
Arc
start, Backend backend)
97
Arc
startArc = start;
126
protected static
Arc
? TrimEnd(
Arc
? end, Backend backend)
132
Arc
endArc = end;
163
internal void AddArc(
Arc
arc) { AddArc(arc, arc); }
174
internal virtual void AddArc(
Arc
start,
Arc
end)
208
Arc
.CopyTags(_endArc, start, Direction.Right);
214
Arc
.CopyTags(start, _endArc, Direction.Left);
230
Arc
.CopyTags(start, _endArc, Direction.Left);
245
Arc
.CopyTags(_endArc, start, Direction.Right);
268
Arc
.CopyTags(start, _endArc, Direction.Left);
303
protected
Arc
? _startArc;
304
protected
Arc
? _endArc;
Internal\SrgsCompiler\Rule.cs (3)
241
private static void TrimEndEpsilons(
Arc
end, Backend backend)
243
Arc
endArc = end;
256
foreach (
Arc
inArc in endState.InArcs.ToList())
Internal\SrgsCompiler\RuleRef.cs (1)
73
Arc
rulerefArc = backend.RuleTransition(ruleRef, _rule, 1.0f);
Internal\SrgsCompiler\State.cs (19)
56
List<
Arc
> outArcs = _outArcs.ToList();
58
Arc
? lastArc = outArcs.Count > 0 ? outArcs[outArcs.Count - 1] : null;
60
IEnumerator<
Arc
> enumArcs = ((IEnumerable<
Arc
>)outArcs).GetEnumerator();
67
foreach (
Arc
arc in outArcs)
89
pWeights[iOffset++] =
Arc
.SerializeExtraEpsilonWithTag(streamBuffer, arc, lastArc == arc, nextAvailableArc);
96
enumArcs = ((IEnumerable<
Arc
>)outArcs).GetEnumerator();
103
foreach (
Arc
arc in outArcs)
119
pWeights[iOffset++] =
Arc
.SerializeExtraEpsilonWithTag(streamBuffer, arc, true, nextAvailableArc);
139
foreach (
Arc
arc in _outArcs)
197
foreach (
Arc
arc in _outArcs)
252
foreach (
Arc
arc in _outArcs)
305
foreach (
Arc
arc in _outArcs)
314
foreach (
Arc
arc in _outArcs)
328
foreach (
Arc
arc in _outArcs)
406
Arc
? arc1 = state1._outArcs != null && !state1._outArcs.IsEmpty ? state1._outArcs.First : null;
407
Arc
? arc2 = state2._outArcs != null && !state2._outArcs.IsEmpty ? state2._outArcs.First : null;
433
foreach (
Arc
arc in _inArcs)
450
foreach (
Arc
arc in _outArcs)