Table of Contents

Method TryFormat

Namespace
LMKit.Speech.Dictation
Assembly
LM-Kit.NET.dll

TryFormat(string, out string)

Attempts to format the text, returning a value indicating success.

public static bool TryFormat(string text, out string result)

Parameters

text string

The raw dictation text to format.

result string

When this method returns, contains the formatted text if formatting succeeded; otherwise, null.

Returns

bool

true if formatting succeeded; otherwise, false.

Remarks

This method catches any exceptions that occur during formatting and returns false instead of throwing. Use this method when robust error handling is required.

TryFormat(string, FormatterOptions, out string)

Attempts to format the text with the specified options, returning a value indicating success.

public static bool TryFormat(string text, FormatterOptions options, out string result)

Parameters

text string

The raw dictation text to format.

options FormatterOptions

The formatting options to use. If null, default options are applied.

result string

When this method returns, contains the formatted text if formatting succeeded; otherwise, null.

Returns

bool

true if formatting succeeded; otherwise, false.