AddRange

SynonymDictionary.AddRange method

Adds the specified collection of synonym groups to this instance of the SynonymDictionary.

public void AddRange(IEnumerable<string[]> synonyms)
Parameter Type Description
synonyms IEnumerable`1 The collection of synonym groups to add to the dictionary.

Exceptions

exception condition
ArgumentNullException Thrown when synonyms or a group of it is null.
ArgumentException Thrown when the number of synonyms in a group is less than 2, or a word of a group is null or contains a line break or an unpaired surrogate.
InvalidOperationException The index of the dictionary is disposed.

Remarks

A word is added without the white space around it and in the lower case. A word that is empty or consists of white space and a repeated word of a group are left out, so a group that is left with one word adds nothing. The groups are checked before the dictionary is changed: a call that throws an exception changes nothing.

See Also