contains method
Leave feedback
On this page
Determines whether the StopWordDictionary contains the specified word.
The case of the letters of the word is not taken into account.
def contains(self, word):
...
| Parameter | Type | Description |
|---|---|---|
| word | str |
The word to locate in the StopWordDictionary. |
Returns: bool: True if the StopWordDictionary contains the specified word; otherwise, False.
if stop_words.contains("But") and stop_words.contains("BY"):
# Removing words from the dictionary
stop_words.remove_range(["but", "by"])
These names call contains too, limited to the overloads listed.
| Alias | Accepts |
|---|---|
contains_file |
contains_file(word) |
contains_string |
contains_string(word) |
- class
StopWordDictionary
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.