Share via


AnalysisHintNode.SetWordlist Method

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

Namespace:  System.Windows.Ink
Assembly:  IAWinFX (in IAWinFX.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

Remarks

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

  • When the Factoid property is set with the (!IS_PHRASELIST) token, the recognizer matches terms that are stored in the word list. If the token is not set, the recognizer matches terms that are stored 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 and fails to match the handwritten phrase to a term, then the recognizer returns nothing. 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, 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 System.Windows.Ink.AnalysisWarningCode value of WordlistNotSupported.

Examples

This example creates an AnalysisHintNode (named theAnalysisHint) for the InkAnalyzer (named 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 AnalysisHintNode = Me.theInkAnalyzerWithHint.CreateAnalysisHint()
theAnalysisHint.Location.MakeInfinite()

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

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

Platforms

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

System.Windows.Ink Namespace