1
Fork 0
mirror of https://github.com/Steffo99/unimore-bda-6.git synced 2024-11-24 16:54:20 +00:00

Fix type annotation of PottsTokenizerWithNegation

This commit is contained in:
Steffo 2023-02-13 15:55:45 +01:00
parent d4373f8c02
commit e93a8ddaf7
Signed by: steffo
GPG key ID: 2A24051445686895

View file

@ -127,7 +127,7 @@ class PottsTokenizerWithNegation(PottsTokenizer):
Version of `.PottsTokenizer` which after tokenizing applies `nltk.sentiment.util.mark_negation`.
"""
def tokenize(self, text: str) -> str:
def tokenize(self, text: str) -> t.Iterator[str]:
# Apply the base tokenization
words = super().tokenize(text)
# Convert to a list (sigh) the iterator