Class Formatter
Formats transcribed dictation text by interpreting spoken formatting commands.
public static class Formatter
- Inheritance
-
Formatter
- Inherited Members
Remarks
The Formatter class transforms raw speech-to-text output into properly formatted text by recognizing spoken commands for punctuation, line breaks, brackets, quotes, and special symbols.
Supports multiple languages including English, French, German, Spanish, Italian, and Portuguese. Commands are matched using case-insensitive regex patterns with Unicode support.
string input = "Hello comma how are you question mark new line I am fine period";
string result = Formatter.Format(input);
// Result: "Hello, how are you?\nI am fine."
var options = new FormatterOptions
{
AutoCapitalize = false,
EnsureSentenceEndings = false
};
string result = Formatter.Format(input, options);
Properties
- Categories
Gets the collection of command category names.
- SupportedLanguages
Gets the collection of supported language codes.
Methods
- ContainsCommands(string)
Determines whether the specified text contains any dictation commands.
- FindCommandMatches(string)
Finds all dictation command matches in the text for highlighting purposes.
- Format(string)
Applies all dictation formatting rules to the input text using default options.
- Format(string, FormatterOptions)
Applies dictation formatting rules to the input text using the specified options.
- GetAllCommands()
Gets all commands across all categories.
- GetAllCommandsForDisplay(string)
Gets all commands formatted for display purposes.
- GetCommandsByCategory(string)
Gets all commands in the specified category.
- TryFormat(string, FormatterOptions, out string)
Attempts to format the text with the specified options, returning a value indicating success.
- TryFormat(string, out string)
Attempts to format the text, returning a value indicating success.