WordList Property

WordList Property

Gets or sets the word list that is used in the recognition process to improve the recognition results.

Declaration

[C++]

[C++]
[propget] HRESULT get_WordList([out,retval]IInkWordList** WordList);
[propputref] HRESULT putref_WordList([in]IInkWordList* WordList);

[Microsoft® Visual Basic® 6.0]

[Visual Basic]
Public Property Get WordList() As InkWordList
Public Property Let WordList( _
    ByVal WordList As InkWordList)

Property Value

InkWordList The word list that is used in the recognition process to improve the recognition results, or NULL (Nothing in Visual Basic 6.0) for the user dictionary.

This property is read/write.

Return Value

HRESULT value Description
S_OK Success.
E_FAIL An unspecified error occurred.
E_INK_EXCEPTION An exception occurred inside method.
E_POINTER The parameter is an invalid out pointer.
TPC_E_OUT_OF_ORDER_CALL This property cannot be assigned after strokes have been added to the Strokes property.

Remarks

Setting this property succeeds only if the Strokes property is NULL. You must set the WordList property before you attach a InkStrokes collection to the Strokes property of the InkRecognizerContext or you must set the Strokes property to null and then set the WordList property (and possibly reattach the InkStrokes collection).

To remove the current word list and use the user dictionary, set this property to NULL. Any subsequent modification of the InkWordList object does not modify the recognition outcome. If you want to change the word list later, change it and then reassign it to the WordList property.

Use the Factoid property to limit the search to the word list that is associated with the context. You may also need to set the RecognitionFlags property to improve the results.

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".

Example

[Visual Basic 6.0]

This Visual Basic 6.0 example shows an example of creating an InkWordList object, theUserWordList, from a Variant array of String, theUserDictionary, and then merging it into the word list of the recognizer context, theRecognizerContext.

[Visual Basic]
'...
Dim theUserWordList As New InkWordList
Dim theUserDictionary() As String
...
Dim theString As String
For Each theString In theUserDictionary
    theUserWordList.AddWord theString
Next
theUserWordList.Merge theRecognizerContext.WordList
' Note: there should be no strokes in the Strokes property of the
' Recognizer Context when setting the WordList property
Set theRecognizerContext.WordList = theUserWordList

Applies To