Skip to content

Commit

Permalink
Update flesch_kincaid_difficulty_estimator.py
Browse files Browse the repository at this point in the history
- Updated values for Portuguese and Polish
- Fixed Constant value for Russian
  • Loading branch information
tfnribeiro committed Feb 3, 2025
1 parent 603c0dd commit 214603c
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ def get_constants_for_language(cls, language: "language"):
# Constants & references https://github.com/Yoast/YoastSEO.js/issues/267#issue-132433796
# INFO: es/it/nl use ( syllables / 100 words ) instead of ( total syllables / total words )
# Multiplying the constants by 100 should approximate this
if language.code == "es":
if language.code in ["es", "pt"]:
return {"start": 206.84, "sentence": 1.02, "word": 60}
if language.code == "it":
return {"start": 217, "sentence": 1.3, "word": 60}
if language.code == "nl":
return {"start": 206.84, "sentence": 0.93, "word": 77}
if language.code == "fr":
return {"start": 207, "sentence": 1.015, "word": 73.6}
if language.code == "ru":
return {"start": 206.835, "sentence": 1.3, "word": 73.6}
if language.code in ["de", "pl", "da"]:
if language.code in ["ru", "pl"]:
return {"start": 206.835, "sentence": 1.3, "word": 60.1}
if language.code in ["de", "da"]:
return {"start": 180, "sentence": 1, "word": 58.5}
return {"start": 206.835, "sentence": 1.015, "word": 84.6}

Expand Down

0 comments on commit 214603c

Please sign in to comment.