AddRange

HomophoneDictionary.AddRange method

Adds the specified collection of homophone groups to this instance of the HomophoneDictionary.

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

Exceptions

exception condition
ArgumentNullException Thrown when homophones or a group of it is null.
ArgumentException Thrown when the number of homophones 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