Skip to content

Fix/default get_lang_cfg#216

Merged
alxwrd merged 5 commits intotextstat:mainfrom
d-led:fix/default-get_lang_cfg
Dec 13, 2025
Merged

Fix/default get_lang_cfg#216
alxwrd merged 5 commits intotextstat:mainfrom
d-led:fix/default-get_lang_cfg

Conversation

@d-led
Copy link
Contributor

@d-led d-led commented Dec 9, 2025

Problem

  • when calculating gunning_fog for es, the call raises an exception due to the missing key syllable_threshold

Analysis

debugging reveals that the function might have been designed to work as:

  • if there's a config value of that key, return that
  • if there's no config value but a default value for that key, return that
  • if there's neither value, throw!

but that's not how it works, and the function throws, even though the default config en exists.

Solution

If the logic is correct, here's the fix in this MR + the test to demonstrate. The logic is made somewhat more trivial.

@alxwrd
Copy link
Member

alxwrd commented Dec 13, 2025

@d-led thanks for finding and raising this!

@alxwrd alxwrd merged commit d2a275b into textstat:main Dec 13, 2025
6 checks passed
@alxwrd
Copy link
Member

alxwrd commented Dec 13, 2025

@d-led
Copy link
Contributor Author

d-led commented Dec 13, 2025

@d-led thanks for finding and raising this!

Superb, thanks likewise!

@d-led d-led deleted the fix/default-get_lang_cfg branch December 13, 2025 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants