Skip to content

Commit

Permalink
Fixing bug with nysiis
Browse files Browse the repository at this point in the history
Fixes #180
  • Loading branch information
Yomguithereal committed Jan 21, 2021
1 parent d118b38 commit dd2ffde
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/phonetics/nysiis.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const PATTERNS = {
[/^(PH|PF)/g, 'FF'],
[/^SCH/g, 'SSS'],
[/(EE|IE)$/g, 'Y'],
[/(DT|RT|RD|NT|ND)$/g, 'D'],
[/(DT|RT|R+D|N+T|N+D)$/g, 'D'],
],
second: [
[/EV/g, 'AF'],
Expand Down Expand Up @@ -53,7 +53,7 @@ const PATTERNS = {
[/IX$/g, 'IC'],
[/EX$/g, 'EC'],
[/(YE|EE|IE)/g, 'Y'],
[/(DT|RT|RD|NT|ND)$/g, 'D'],
[/(DT|RT|R+D|N+T|N+D)$/g, 'D'],
[/(.+)EV/g, '$1EF'],
],
second: [
Expand Down
6 changes: 4 additions & 2 deletions test/phonetics/nysiis.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ describe('nysiis', function() {
['LANDGRAN', 'Lundgren'],
['FFALBAD', 'Philbert'],
['HARY', 'Harry'],
['MCANSY', 'Mackenzie']
['MCANSY', 'Mackenzie'],
['ANAD', 'ANANND']
];

tests.forEach(function([code, word]) {
Expand All @@ -48,7 +49,8 @@ describe('nysiis', function() {
['LANGRAN', 'Lundgren'],
['FALBAD', 'Philbert'],
['HARY', 'Harry'],
['MCANSY', 'Mackenzie']
['MCANSY', 'Mackenzie'],
['ANAD', 'ANANND']
];

tests.forEach(function([code, word]) {
Expand Down

0 comments on commit dd2ffde

Please sign in to comment.