syllable icon indicating copy to clipboard operation
syllable copied to clipboard

Anx is a single syllable - issue #46

Open RamakrishnanArun opened this issue 5 years ago • 8 comments

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 image

and https://www.merriam-webster.com/dictionary/anxious https://www.dictionary.com/browse/anxious?s=t

RamakrishnanArun avatar Oct 15 '20 23:10 RamakrishnanArun

Codecov Report

Merging #47 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update d7f2e84...80b8c47. Read the comment docs.

codecov-io avatar Oct 15 '20 23:10 codecov-io

Codecov Report

Merging #47 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update d7f2e84...80b8c47. Read the comment docs.

codecov-commenter avatar Oct 15 '20 23:10 codecov-commenter

Codecov Report

Merging #47 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@            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 data Powered by Codecov. Last update d7f2e84...80b8c47. Read the comment docs.

codecov-io avatar Oct 15 '20 23:10 codecov-io

Nice, thanks for working on a fix!

  1. 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
  1. Could you add the new test cases (as as a couple of the above, and anxious itself) to the javascript tests instead of the fixtures? Like so perhaps: https://github.com/words/syllable/blob/d7f2e84345dffe92b9264d08c5edd22a870013bc/test/index.js#L235-L263

wooorm avatar Oct 16 '20 06:10 wooorm

Yeah, I realised later that some of those words didn't match, like anxiety for example. Looking at that now.

RamakrishnanArun avatar Oct 16 '20 09:10 RamakrishnanArun

This is proving to be a little more tricky than I thought. I will step through the code a little more.

RamakrishnanArun avatar Oct 17 '20 12:10 RamakrishnanArun

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

wooorm avatar Oct 17 '20 14:10 wooorm

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.

RamakrishnanArun avatar Oct 19 '20 22:10 RamakrishnanArun