Skip to content

Instantly share code, notes, and snippets.

@colomon
Last active December 13, 2015 20:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save colomon/4970109 to your computer and use it in GitHub Desktop.
Save colomon/4970109 to your computer and use it in GitHub Desktop.
sub syllable($word is copy) is export {
$word = $word.lc.subst("'", "").subst(/ 'e' $/ , "");
my $syl = $word.comb(/<[aeiouy]>+/) # count vowel groupings
+ @AddSyl.grep(-> $re { $word ~~ $re })
- @SubSyl.grep(-> $re { $word ~~ $re });
return max($syl, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment