Compartir a través de


WordList.Add Method (String)

Adds a single string to the WordList object.

Namespace: Microsoft.Ink
Assembly: Microsoft.Ink (in microsoft.ink.dll)

Syntax

'Declaration
Public Sub Add ( _
    s As String _
)
'Usage
Dim instance As WordList
Dim s As String

instance.Add(s)
public void Add (
    string s
)
public:
void Add (
    String^ s
)
public void Add (
    String s
)
public function Add (
    s : String
)
Not applicable.

Parameters

  • s
    The string to add to the WordList object.

Remarks

The string passed in to the s parameter is not added if it already exists in the WordList object.

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

A WordList object can include string representations of words, phrases, part numbers, or any other string that a user might write that is not in the system dictionary.

There is a 256 character limit for words in a WordList. Using words longer than 256 characters will result in an invalid pointer exception when assigning the WordList to a RecognizerContext.

Example

This C# example adds the word Microsoft to the WordList object that the RecognizerContext object, theRecognizerContext, uses.

RecognizerContext theRecognizerContext = new RecognizerContext();
WordList theWordList = new WordList();
theWordList.Add("Microsoft");
theRecognizerContext.WordList = theWordList;

This Microsoft® Visual Basic® .NET example adds the word Microsoft to the WordList object that the RecognizerContext object, theRecognizerContext, uses.

Dim theRecognizerContext As New RecognizerContext()
Dim theWordList As New WordList()
theWordList.Add("Microsoft")
theRecognizerContext.WordList = theWordList

Platforms

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

Version Information

.NET Framework

Supported in: 3.0

See Also

Reference

WordList Class
WordList Members
Microsoft.Ink Namespace
RecognizerContext
WordList.Remove