Class RegexpTreeBuilder
Contains methods for converting automata into regular expressions.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions.Automata
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public static class RegexpTreeBuilder
Methods
BuildCompactRegex<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>(Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>, Boolean)
Builds a regular expression tree for the support of a given automaton.
Declaration
public static RegexpTreeNode<TElement, TElementDistribution> BuildCompactRegex<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>(Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton> automaton, bool collapseAlternatives = true)
where TSequence : class, IEnumerable<TElement> where TElementDistribution : IImmutableDistribution<TElement, TElementDistribution>, CanGetLogAverageOf<TElementDistribution>, CanComputeProduct<TElementDistribution>, CanCreatePartialUniform<TElementDistribution>, SummableExactly<TElementDistribution>, new()
where TSequenceManipulator : ISequenceManipulator<TSequence, TElement>, new()
where TAutomaton : Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>, new()
Parameters
Type | Name | Description |
---|---|---|
Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton> | automaton | The automaton. |
Boolean | collapseAlternatives | Specifies whether an attempt to merge identical sub-expressions should be made. Setting it to false will improve the performance, but produce longer regular expressions. Defaults to true. |
Returns
Type | Description |
---|---|
RegexpTreeNode<TElement, TElementDistribution> | The built regular expression tree. |
Type Parameters
Name | Description |
---|---|
TSequence | The type of a sequence. |
TElement | The type of a sequence element. |
TElementDistribution | The type of a distribution over sequence elements. |
TSequenceManipulator | The type providing ways to manipulate sequences. |
TAutomaton | The concrete type of an automaton. |
BuildRegexp<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>(Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>, Boolean)
Builds a regular expression tree for the support of a given automaton.
Declaration
public static RegexpTreeNode<TElement, TElementDistribution> BuildRegexp<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>(Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton> automaton, bool collapseAlternatives = true)
where TSequence : class, IEnumerable<TElement> where TElementDistribution : IImmutableDistribution<TElement, TElementDistribution>, CanGetLogAverageOf<TElementDistribution>, CanComputeProduct<TElementDistribution>, CanCreatePartialUniform<TElementDistribution>, SummableExactly<TElementDistribution>, new()
where TSequenceManipulator : ISequenceManipulator<TSequence, TElement>, new()
where TAutomaton : Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>, new()
Parameters
Type | Name | Description |
---|---|---|
Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton> | automaton | The automaton. |
Boolean | collapseAlternatives | Specifies whether an attempt to merge identical sub-expressions should be made. Setting it to false will improve the performance, but produce longer regular expressions. Defaults to true. |
Returns
Type | Description |
---|---|
RegexpTreeNode<TElement, TElementDistribution> | The built regular expression tree. |
Type Parameters
Name | Description |
---|---|
TSequence | The type of a sequence. |
TElement | The type of a sequence element. |
TElementDistribution | The type of a distribution over sequence elements. |
TSequenceManipulator | The type providing ways to manipulate sequences. |
TAutomaton | The concrete type of an automaton. |