Class WordStrings
Sets of strings of whole words.
Inherited Members
Namespace: Microsoft.ML.Probabilistic.Distributions
Assembly: Microsoft.ML.Probabilistic.dll
Syntax
public static class WordStrings
Methods
EmptyOrEndsWith(ImmutableDiscreteChar, ImmutableDiscreteChar)
Declaration
public static StringDistribution EmptyOrEndsWith(ImmutableDiscreteChar charsInMainString, ImmutableDiscreteChar endsWith)
Parameters
Type | Name | Description |
---|---|---|
ImmutableDiscreteChar | charsInMainString | |
ImmutableDiscreteChar | endsWith |
Returns
Type | Description |
---|---|
StringDistribution |
EmptyOrStartsWith(ImmutableDiscreteChar, ImmutableDiscreteChar)
Declaration
public static StringDistribution EmptyOrStartsWith(ImmutableDiscreteChar charsInMainString, ImmutableDiscreteChar startsWith)
Parameters
Type | Name | Description |
---|---|---|
ImmutableDiscreteChar | charsInMainString | |
ImmutableDiscreteChar | startsWith |
Returns
Type | Description |
---|---|
StringDistribution |
WordMiddle()
Creates a uniform distribution over any string starting and ending with a non-word character (possibly of length 1).
Declaration
public static StringDistribution WordMiddle()
Returns
Type | Description |
---|---|
StringDistribution | The created distribution. |
WordMiddle(ImmutableDiscreteChar, Nullable<ImmutableDiscreteChar>)
Creates a uniform distribution over any string starting and ending with a non-word character. Characters other than the first and the last are restricted to be non-zero probability characters from a given distribution.
Declaration
public static StringDistribution WordMiddle(ImmutableDiscreteChar allowedChars, ImmutableDiscreteChar? nonWordCharacter = null)
Parameters
Type | Name | Description |
---|---|---|
ImmutableDiscreteChar | allowedChars | The distribution representing allowed characters. |
Nullable<ImmutableDiscreteChar> | nonWordCharacter | The word separating characters. |
Returns
Type | Description |
---|---|
StringDistribution | The created distribution. |
WordMiddle(Int32, Int32)
Creates a uniform distribution over any string starting and ending with a non-word character, with a length in given bounds.
Declaration
public static StringDistribution WordMiddle(int minLength, int maxLength)
Parameters
Type | Name | Description |
---|---|---|
Int32 | minLength | The minimum allowed string length. |
Int32 | maxLength | The maximum allowed string length. |
Returns
Type | Description |
---|---|
StringDistribution | The created distribution. |
WordMiddle(Int32, Int32, ImmutableDiscreteChar)
Creates a uniform distribution over any string starting and ending with a non-word character, with a length in given bounds. Characters other than the first and the last are restricted to be non-zero probability characters from a given distribution.
Declaration
public static StringDistribution WordMiddle(int minLength, int maxLength, ImmutableDiscreteChar allowedChars)
Parameters
Type | Name | Description |
---|---|---|
Int32 | minLength | The minimum allowed string length. |
Int32 | maxLength | The maximum allowed string length. |
ImmutableDiscreteChar | allowedChars | The distribution representing allowed characters. |
Returns
Type | Description |
---|---|
StringDistribution | The created distribution. |
WordPrefix()
Creates a uniform distribution over either the empty string or any string ending with a non-word character.
Declaration
public static StringDistribution WordPrefix()
Returns
Type | Description |
---|---|
StringDistribution | The created distribution. |
WordPrefix(ImmutableDiscreteChar)
Creates a uniform distribution over either the empty string or any string ending with a non-word character. Characters other than the last are restricted to be non-zero probability characters from a given distribution.
Declaration
public static StringDistribution WordPrefix(ImmutableDiscreteChar allowedChars)
Parameters
Type | Name | Description |
---|---|---|
ImmutableDiscreteChar | allowedChars | The distribution representing allowed characters. |
Returns
Type | Description |
---|---|
StringDistribution | The created distribution. |
WordSuffix()
Creates a uniform distribution over either the empty string or any string starting with a non-word character.
Declaration
public static StringDistribution WordSuffix()
Returns
Type | Description |
---|---|
StringDistribution | The created distribution. |
WordSuffix(ImmutableDiscreteChar)
Creates a uniform distribution over either the empty string or any string starting with a non-word character. Characters other than the last are restricted to be non-zero probability characters from a given distribution.
Declaration
public static StringDistribution WordSuffix(ImmutableDiscreteChar allowedChars)
Parameters
Type | Name | Description |
---|---|---|
ImmutableDiscreteChar | allowedChars | The distribution representing allowed characters. |
Returns
Type | Description |
---|---|
StringDistribution | The created distribution. |