Share via


AnalysisHintNode.SetWordlist Method

Changes the word list for this analysis hint. The word list supplements or replaces the dictionary as a source of possible terms to match with handwriting.

Namespace:  Microsoft.Ink
Assembly:  Microsoft.Ink.Analysis (in Microsoft.Ink.Analysis.dll)

Syntax

'Declaration
Public Sub SetWordlist ( _
    wordlist As String() _
)
'Usage
Dim instance As AnalysisHintNode 
Dim wordlist As String()

instance.SetWordlist(wordlist)
public void SetWordlist(
    string[] wordlist
)
public:
void SetWordlist(
    array<String^>^ wordlist
)
public function SetWordlist(
    wordlist : String[]
)

Parameters

  • wordlist
    Type: array<System.String[]

    A string array to add a word list, or nulla null reference (Nothing in Visual Basic) to remove the word list.

Remarks

The Factoid and CoerceToFactoid properties and the word list interact to modify how handwriting is matched to terms.

  • When the Factoid property is set with the (!IS_PHRASELIST) token, the recognizer matches to terms in the word list instead of the dictionary. If the token is not set, the recognizer matches to terms in both the word list and the dictionary.

  • The CoerceToFactoid property determines whether the recognizer will return words that are not matched in either the dictionary or word list. If the property is set to true, the recognizer returns nothing if it fails to match the handwritten phrase to a term. If CoerceToFactoid is set to false, the recognizer favors matched results, but can return a string that does not occur in either list.

The following table summarizes possible return values given various combinations of these property settings:

Factoid

CoerceToFactoid

Possible Return Values

Does not contain (!IS_PHRASELIST) or "WORDLIST"

false

A value from either the word list or the dictionary, or an unlisted result.

Contains (!IS_PHRASELIST) or "WORDLIST"

false

A value from the word list, or an unlisted result.

Contains "(!IS_PHRASELIST)" or "WORDLIST"

true

A value from the word list, or nothing.

If a string is added to a word list, its capitalized versions are also implicitly added. For instance, adding "hello" implicitly adds "Hello" and "HELLO".

To return the hint's word list, use GetWordlist.

During analysis, if the ink recognizer applied to the strokes does not support word lists, the ink analyzer generates an AnalysisWarning with its WarningCode property set to the Microsoft.Ink.AnalysisWarningCode value of WordlistNotSupported.

Examples

This example creates an AnalysisHintNode, theAnalysisHint, for the InkAnalyzer, theInkAnalyzerWithHint, and makes theAnalysisHint a global hint. It then adds a word list to the hint and sets the hint's name.

' Add a new, global analysis hint to theInkAnalyzerWithHint. 
Dim theAnalysisHint As Microsoft.Ink.AnalysisHintNode = _
    Me.theInkAnalyzerWithHint.CreateAnalysisHint()
theAnalysisHint.Location.MakeInfinite()

theAnalysisHint.SetWordlist(TheForm.theWordList)
theAnalysisHint.Name = "Wordlist"
// Add a new, global analysis hint to theInkAnalyzerWithHint.
Microsoft.Ink.AnalysisHintNode theAnalysisHint =
    this.theInkAnalyzerWithHint.CreateAnalysisHint();
theAnalysisHint.Location.MakeInfinite();

theAnalysisHint.SetWordlist(TheForm.theWordList);
theAnalysisHint.Name = "Wordlist";

Platforms

Windows 7, Windows Vista, Windows Server 2008 R2, Windows Server 2008

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

AnalysisHintNode Class

AnalysisHintNode Members

Microsoft.Ink Namespace