WordList.Add - метод (array<String[])
Обновлен: Ноябрь 2007
Adds an array of strings containing words to the WordList.
Пространство имен: Microsoft.Ink
Сборка: Microsoft.Ink (в Microsoft.Ink.dll)
Синтаксис
'Декларация
Public Sub Add ( _
words As String() _
)
'Применение
Dim instance As WordList
Dim words As String()
instance.Add(words)
public void Add(
string[] words
)
public:
void Add(
array<String^>^ words
)
public void Add(
String[] words
)
public function Add(
words : String[]
)
Параметры
- words
Тип: array<System.String[]
An array of strings containing words to be added to the WordList.
Заметки
Any string contained in the words parameter array 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.
Примеры
In this example, two WordList objects are created and words are added to their collections. Using the Merge method, the contents of the two WordList objects are combined. Finally, a RecognizerContext object is instantiated, and the first WordList object assigned to its WordList property.
Dim wList1 As WordList = New WordList()
Dim wList2 As WordList = New WordList()
' add a single word to wList1
wList1.Add("thunk")
' add an array of words to wList2
Dim words() As String = {"Microsoft", "Tablet", "PC"}
wList2.Add(words)
' merge wList2 into wList1
wList1.Merge(wList2)
' create a new RecognizerContext object and assign wList1
Dim RC As RecognizerContext = New RecognizerContext()
RC.WordList = wList1
WordList wList1 = new WordList();
WordList wList2 = new WordList();
// add a single word to wList1
wList1.Add("thunk");
// add an array of words to wList2
string[] words = { "Microsoft", "Tablet", "PC" };
wList2.Add(words);
// merge wList2 into wList1
wList1.Merge(wList2);
// create a new RecognizerContext object and assign wList1
RecognizerContext RC = new RecognizerContext();
RC.WordList = wList1;
Платформы
Windows Vista
Среды .NET Framework и .NET Compact Framework поддерживают не все версии каждой платформы. Поддерживаемые версии перечислены в разделе Требования к системе для .NET Framework.
Сведения о версии
.NET Framework
Поддерживается в версии: 3.0