Sha256: f26543fa4acb72e4abce5e66311cb2a81d6067a9bd653a84aeb536d3c3535d4a
Contents?: true
Size: 1.41 KB
Versions: 1
Compression:
Stored size: 1.41 KB
Contents
# SyllableCounter Takes a string and returns the number of syllables. ## Installation Add this line to your application's Gemfile: gem 'syllable_counter' And then execute: $ bundle Or install it yourself as: $ gem install syllable_counter ## Usage To get the number of syllables for a string: SyllableCounter::Count.get_syllables("Text to be evaluated goes here") #=> 10 ## Algorithm The algorithm is not corpus-based but based upon phonemic complementary distributions as they exist in American English. This is an introductory set that will keep growing. Suggestions for additions are absolutely welcome! Email me at kelseymok@gmail.com. 1. Assumes at least one obligatory vowel per syllable 2. Final /e/ is not realized unless the final /e/ is preceded by an /l/ or /r/ and a consonant (ie. -dle, -cre). 3. Final /ed/ suffix is only realized when preceeded by a /t/ or /d/ 4. Final /es/ plural suffix is realized after /s/ /z/ /sh/ /dg/ /ch/ /[aeiou]g/ 5. Two consecutive vowels outside of /[aeiouy]o/ are combined as one syllable Pending 1. /[aeiuy]o/ does not get merged as one syllable (ie. aon, ion, eon) 2. /iu/ combinations are two syllables 2. Exceptions: "maybe", "Wednesday" 3. Dialect-specific versions for English ##Contributing Submit a pull request! The code is structured so that you can easily add a rule or an exception and specs. If the PR hasn't been addressed, feel free to ping me.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
syllable_counter-1.0.0 | README.md |