INNER CODE UNIT · Python
token_require_spell_check
R1j1t/contextualSpellCheck · contextualSpellCheck/contextualSpellCheck.py:443
def token_require_spell_check(token):
"""Getter for Token attributes.
Args:
token {`Spacy.Token`}: Token object for the value should be returned
Returns:
List: If no suggestions: False else: True
"""
return any(
[
token.i == suggestion.i and token.text == suggestion.text
for suggestion in token.doc._.suggestions_spellCheck.keys()
]
)
@staticmethod
def token_suggestion_spell_check(token):
"""
Getter for Token attributes.