Skip to content

Commit

Permalink
Handle more than one 'M' at end of word (i.e.: alissonn)
Browse files Browse the repository at this point in the history
Thanks @vyper!
  • Loading branch information
sobrinho committed Dec 6, 2011
1 parent 3ea69d7 commit b541f41
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
master

* Handle more than one 'M' at end of word (ie: alissonn)

Thanks @vyper!

1.0.0 [Sun Jun 19 2011]

* Use replacements table proposed by Marcos Rodrigues Caso (see:
Expand Down
2 changes: 1 addition & 1 deletion lib/fonetica.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Fonetica
[/CT|RT|ST|PT/, 'T'],
[/\b[UW]/, 'V'],
['RM', 'SM'],
[/[MRS]\b/, ''],
[/[MRS]+\b/, ''],
[/[AEIOUH]/, '']
]

Expand Down
4 changes: 4 additions & 0 deletions test/fonetica_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ def test_batista_and_baptista
assert_fonetica 'batista', 'baptista'
end

def test_alisson_and_allissonn
assert_fonetica 'alison', 'allisonn'
end

protected

def assert_fonetica(first, second)
Expand Down

0 comments on commit b541f41

Please sign in to comment.