syllable
syllable copied to clipboard
Anx is a single syllable - issue #46
Fix for https://github.com/words/syllable/issues/46
Added a fix for the word anxious which is 2 syllables as you can see from the google search and dictionaries.
https://www.google.com/search?q=anxious

and https://www.merriam-webster.com/dictionary/anxious https://www.dictionary.com/browse/anxious?s=t
Codecov Report
Merging #47 into master will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #47 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 74 74
=========================================
Hits 74 74
| Impacted Files | Coverage Δ | |
|---|---|---|
| index.js | 100.00% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update d7f2e84...80b8c47. Read the comment docs.
Codecov Report
Merging #47 into master will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #47 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 74 74
=========================================
Hits 74 74
| Impacted Files | Coverage Δ | |
|---|---|---|
| index.js | 100.00% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update d7f2e84...80b8c47. Read the comment docs.
Codecov Report
Merging #47 into master will not change coverage. The diff coverage is
n/a.
@@ Coverage Diff @@
## master #47 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 2 2
Lines 74 74
=========================================
Hits 74 74
| Impacted Files | Coverage Δ | |
|---|---|---|
| index.js | 100.00% <ø> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing dataPowered by Codecov. Last update d7f2e84...80b8c47. Read the comment docs.
Nice, thanks for working on a fix!
- Could you check a couple of other words with those letters?
$ sed -n '/anx/p' < /usr/share/dict/words
anxietude
anxiety
anxious
anxiously
anxiousness
banxring
Caranx
lanx
Manx
Manxman
Manxwoman
overanxiety
overanxious
overanxiously
phalanx
phalanxed
planxty
reanxiety
unanxiety
unanxious
unanxiously
unanxiousness
- Could you add the new test cases (as as a couple of the above, and
anxiousitself) to the javascript tests instead of the fixtures? Like so perhaps: https://github.com/words/syllable/blob/d7f2e84345dffe92b9264d08c5edd22a870013bc/test/index.js#L235-L263
Yeah, I realised later that some of those words didn't match, like anxiety for example. Looking at that now.
This is proving to be a little more tricky than I thought. I will step through the code a little more.
Hmm, yeah this can be tricky, because of so many weird regex interplay. Syllables are hard!
If there is no way around it, problematic.json could be an escape hatch, but as that’s not scalable, code is preferred
I want to avoid adding it to the problematic.json file. There are other similar words like society that might benefit from these patterns too.