Skip to content

Commit

Permalink
Fix awe, awesome
Browse files Browse the repository at this point in the history
Closes GH-32.
Closes GH-33.
  • Loading branch information
wooorm committed Aug 12, 2019
1 parent a30ec92 commit bbcad6f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ var own = {}.hasOwnProperty
// syllables, but should be counted as one.
var EXPRESSION_MONOSYLLABIC_ONE = new RegExp(
[
'awe($|d|so)',
'cia(?:l|$)',
'tia',
'cius',
Expand Down Expand Up @@ -217,7 +218,7 @@ var EXPRESSION_DOUBLE = new RegExp(
'somer'
].join('|') +
')',
'(?:' + ['fully', 'berry', 'woman', 'women', 'edly'].join('|') + ')$'
'(?:fully|berry|woman|women|edly)$'
].join('|'),
'g'
)
Expand Down
30 changes: 27 additions & 3 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,33 @@ test('api', function(t) {
t.equal(syllable('Snuffleupagus'), 5, 'GH-25 (snuffleupagus)')
t.equal(syllable('queue'), 1, 'GH-26 (queue)')

t.equal(syllable('real'), 1, 'GH-31 (real/deal/really)')
t.equal(syllable('deal'), 1, 'GH-31 (real/deal/really)')
t.equal(syllable('really'), 2, 'GH-31 (real/deal/really)')
t.deepEqual(
['real', 'deal', 'really'].map(syllable),
[1, 1, 2],
'GH-31 (real/deal/really)'
)

t.deepEqual(
[
'awe',
'awearied',
'aweary',
'aweather',
'aweband',
'awedness',
'awee',
'aweek',
'aweel',
'aweigh',
'awesome',
'awesomely',
'awesomeness',
'awest',
'aweto'
].map(syllable),
[1, 3, 3, 3, 3, 2, 2, 2, 2, 2, 2, 3, 3, 2, 3],
'GH-32 (awe)'
)

t.end()
})
Expand Down

0 comments on commit bbcad6f

Please sign in to comment.