-
Notifications
You must be signed in to change notification settings - Fork 183
Labels
bugpr welcomeFeel free to raise a pull request for this issueFeel free to raise a pull request for this issuepriority: high
Description
Operating system
Linux
Download source
PyPi
Python distribution
CPython
Python version
Python 3.10
What happened?
import textstat
textstat.flesch_kincaid_grade("text_a")throws:
Traceback (most recent call last):
File "/Users/harutaka.kawamura/Desktop/repositories/mlflow/a.py", line 3, in <module>
textstat.flesch_kincaid_grade("text_a")
File "/Users/harutaka.kawamura/.cache/uv/archive-v0/pcIiuLBSbAJHAXJPQlxRe/lib/python3.10/site-packages/textstat/textstat.py", line 584, in flesch_kincaid_grade
return self._legacy_round(metrics.flesch_kincaid_grade(text, self.__lang))
File "/Users/harutaka.kawamura/.cache/uv/archive-v0/pcIiuLBSbAJHAXJPQlxRe/lib/python3.10/site-packages/textstat/backend/metrics/_flesch_kincaid_grade.py", line 34, in flesch_kincaid_grade
syllables = syllables_per_word(text, lang)
File "/Users/harutaka.kawamura/.cache/uv/archive-v0/pcIiuLBSbAJHAXJPQlxRe/lib/python3.10/site-packages/textstat/backend/metrics/_syllables_per_word.py", line 26, in syllables_per_word
return count_syllables(text, lang) / count_words(text)
File "/Users/harutaka.kawamura/.cache/uv/archive-v0/pcIiuLBSbAJHAXJPQlxRe/lib/python3.10/site-packages/textstat/backend/counts/_count_syllables.py", line 30, in count_syllables
cmu_phones = cmu_dict[word][0]
KeyError: 'text_a'
Other information
Failing tests
def test_the_bug_i_found():
assert TrueCode of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
bugpr welcomeFeel free to raise a pull request for this issueFeel free to raise a pull request for this issuepriority: high