get_homophones method
Leave feedback
On this page
Gets the homophones for the specified word.
The case of the letters of the word is not taken into account.
def get_homophones(self, word):
...
| Parameter | Type | Description |
|---|---|---|
| word | str |
The word to suggest the homophones. |
Returns: The homophones for the specified word or empty list if the HomophoneDictionary object does not contain the specified word.
| Raises | Description |
|---|---|
ValueError |
When word is None. |
words = homophones.get_homophones("Braid")
print("Homophones for 'braid':")
for w in words:
print(w)
These names call get_homophones too, limited to the overloads listed.
| Alias | Accepts |
|---|---|
get_homophones_file |
get_homophones_file(word) |
get_homophones_string |
get_homophones_string(word) |
- 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.