add_range method
Leave feedback
On this page
Adds the specified collection of homophone groups to this instance of the HomophoneDictionary.
def add_range(self, homophones):
...
| Parameter | Type | Description |
|---|---|---|
| homophones | Iterable[list[str]] |
The collection of homophone groups to add to the dictionary. |
| Raises | Description |
|---|---|
ValueError |
If a group contains fewer than 2 homophones. |
homophone_groups = [
["awe", "oar", "or", "ore"],
["aye", "eye", "i"],
]
homophones.add_range(homophone_groups)
print("Words in the dictionary:", homophones.count)
These names call add_range too, limited to the overloads listed.
| Alias | Accepts |
|---|---|
add_range_files |
add_range_files(homophones) |
add_range_strings |
add_range_strings(homophones) |
add_range_ienumerable |
add_range_ienumerable(homophones) |
- class
HomophoneDictionary
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.