Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

DM-Soundex precision now can be tuned with the second arg to the process() call #63

Merged
merged 1 commit into from

2 participants

@maslennikov

No description provided.

@chrisumbel
Owner

thank you much!

@chrisumbel chrisumbel merged commit 4e47dcf into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 12, 2012
  1. dm_soundex.process now accepts optional output length

    Alexy Maslennikov authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/natural/phonetics/dm_soundex.js
View
6 lib/natural/phonetics/dm_soundex.js
@@ -175,9 +175,9 @@ var codes = {
};
-function process(word) {
+function process(word, codeLength) {
+ codeLength = codeLength || 6;
word = word.toUpperCase();
- var minLen = 6;
var output = '';
var pos = 0, lastCode = -1;
@@ -203,7 +203,7 @@ function process(word) {
}
- return normalizeLength(output);
+ return normalizeLength(output, codeLength);
}
Something went wrong with that request. Please try again.