Class Transducer<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TThis>
A base class for weighted finite state transducers that are defined on sequences of the same type.
Inheritance
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton,
ImmutablePairDistribution<TElement, TElementDistribution>, TThis>
Transducer<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TThis>
Inherited Members
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.sequencePairToWeight
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Consume(TAutomaton)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Consume(TSequence)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.ConsumeElement(TElement)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Produce(TAutomaton)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Produce(TSequence)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.ProduceElement(TElement)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.ProduceElement(TElementDistribution)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Replace(TAutomaton, TAutomaton)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Replace(TSequence, TSequence)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Replace(TElementDistribution, TElementDistribution)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Sum(TThis[])
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Sum(IEnumerable<TThis>)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Concatenate(TThis[])
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Concatenate(IEnumerable<TThis>)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Repeat(TThis, Int32, Nullable<Int32>)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Optional(TThis)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.GetLogValue(TSequence, TSequence)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.GetValue(TSequence, TSequence)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Append(TThis)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.AppendInPlace(TThis, Int32)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.ProjectSource(TAutomaton)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.ProjectSource(TSequence)
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.Clone()
TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis>.SetTo(TThis)
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public abstract class Transducer<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TThis> : TransducerBase<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, ImmutablePairDistribution<TElement, TElementDistribution>, TThis> where TSequence : class, IEnumerable<TElement> where TElementDistribution : IImmutableDistribution<TElement, TElementDistribution>, CanGetLogAverageOf<TElementDistribution>, CanComputeProduct<TElementDistribution>, CanCreatePartialUniform<TElementDistribution>, SummableExactly<TElementDistribution>, Sampleable<TElement>, new()
where TSequenceManipulator : ISequenceManipulator<TSequence, TElement>, new()
where TAutomaton : Automaton<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton>, new()
where TThis : Transducer<TSequence, TElement, TElementDistribution, TSequenceManipulator, TAutomaton, TThis>, new()
Type Parameters
Name |
Description |
TSequence |
The type of a sequence in a pair.
|
TElement |
The type of an element of TSequence .
|
TElementDistribution |
The type of a distribution over TElement .
|
TSequenceManipulator |
The type providing ways to manipulate sequences of type TSequence .
|
TAutomaton |
The type of an automaton defined on TSequence .
|
TThis |
The type of a concrete transducer class.
|
Methods
Copy()
Creates a transducer T(a, b) = I[a = b]
.
Declaration
public static TThis Copy()
Returns
Type |
Description |
TThis |
The created transducer.
|
Copy(TSequence)
Creates a transducer T(a, b) = I[a = A] I[a = b]
, where A
is a given sequence.
Declaration
public static TThis Copy(TSequence sequence)
Parameters
Type |
Name |
Description |
TSequence |
sequence |
The sequence to constrain the arguments.
|
Returns
Type |
Description |
TThis |
The created transducer.
|
Copy(TElementDistribution)
Creates a transducer T(a, b) = I[A[i] is in C for all i] I[a = b]
,
where C
is the support of a given element distribution.
Declaration
public static TThis Copy(TElementDistribution allowedElements)
Parameters
Type |
Name |
Description |
TElementDistribution |
allowedElements |
Specifies the elements allowed in the transducer arguments.
|
Returns
Type |
Description |
TThis |
The created transducer.
|
Copy(TAutomaton, Int32)
Creates a transducer T(a, b) = f(a) I[a = b]
, where f(a)
is a given automaton.
Declaration
public static TThis Copy(TAutomaton automaton, int group = 0)
Parameters
Type |
Name |
Description |
TAutomaton |
automaton |
The automaton to weight the sequence.
|
Int32 |
group |
The group.
|
Returns
Type |
Description |
TThis |
The created transducer.
|
CopyElement(TElement)
Creates a transducer T(a, b) = I[a[0] = c, |a| = 1] I[a = b]
,
where c
is a given element.
Declaration
public static TThis CopyElement(TElement element)
Parameters
Type |
Name |
Description |
TElement |
element |
The element allowed in the transducer arguments.
|
Returns
Type |
Description |
TThis |
The created transducer.
|
CopyElement(TElementDistribution)
Creates a transducer T(a, b) = I[a[0] is in C, |a| = 1] I[a = b]
,
where C
is the support of a given element distribution.
Declaration
public static TThis CopyElement(TElementDistribution allowedElements)
Parameters
Type |
Name |
Description |
TElementDistribution |
allowedElements |
Specifies the elements allowed in the transducer arguments.
|
Returns
Type |
Description |
TThis |
The created transducer.
|
FromAutomaton(TAutomaton, Func<Option<TElementDistribution>, Weight, (Option<ImmutablePairDistribution<TElement, TElementDistribution>>, Weight)>)
Creates a transducer from a given automaton by applying a converter to its element distributions.
Declaration
public static TThis FromAutomaton(TAutomaton automaton, Func<Option<TElementDistribution>, Weight, (Option<ImmutablePairDistribution<TElement, TElementDistribution>>, Weight)> transitionTransform)
Parameters
Returns
Type |
Description |
TThis |
The created transducer.
|
Transpose(TThis)
Creates a transducer T'(b, a) = T(a, b)
, where T(a, b)
is a given transducer.
Declaration
public static TThis Transpose(TThis transducer)
Parameters
Type |
Name |
Description |
TThis |
transducer |
The transducer to transpose.
|
Returns
Type |
Description |
TThis |
The created transducer.
|