Skip to content
This repository was archived by the owner on Jun 3, 2019. It is now read-only.

Commit 42a32b1

Browse files
committed
Used abs to check syllable diff
1 parent 5815690 commit 42a32b1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/utils/test_language.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def validate_syllables(syllables):
1515
correct = 0
1616
words = get_words_file(syllables)
1717
for word in words:
18-
if num_syllables(word) - syllables <= 0: # 1 off is accurate enough
18+
if abs(num_syllables(word) - syllables) < 2: # 1 off is accurate enough
1919
correct += 1
2020
assert correct/len(words) > .90 # 90% is good enough
2121

0 commit comments

Comments
 (0)