<span id="goog_1452677146"></span><span id="goog_1452677147"></span><a href="/"></a>On 10 October 2010 23:41, Michael Neale &lt;<a href="mailto:michael.neale@gmail.com">michael.neale@gmail.com</a>&gt; wrote:<br>&gt; I think you should clean room implement it (or reuse some old code of yours<br>
&gt; if it is safe to do so). From what I have seen of the algorithm - it isn&#39;t<br>&gt; huge - and it would make sense to have it re-implemented. As an alternative<br>&gt; - consider taking a look at the MVEL soundex code and rewriting that - and<br>
&gt; we will see if we can make it upstream.<br><br>I just re-implemented this according to the algorithm I found in<br> <a href="http://en.wikipedia.org/wiki/Soundex">http://en.wikipedia.org/wiki/Soundex</a><br>I&#39;ve also consulted a CPAN module, to learn what was intended by the<br>
MVEL implementation, but it&#39;s undecidable (possibly due to omissions or<br>bugs).<br><br>&gt; I would say it is just slightly<br>&gt; neglected  - its not well known that it lives there. Using the MVEL one was<br>&gt; just opportunistic for drools. <br>
&gt; I didn&#39;t know that it could return null, that is bad. I guess if it is null<br>&gt; - that would mean that you just do a literal case insensitive compare?<br><br>A correct implementation never returns null. An empty word might, but for<br>
our purpose &quot;&quot; would be preferable.<br><br>&gt; Also - AFAIK - soundex is only for english right?<br>Certainly.<br><br>&gt; Is there an equivalent for other languages?<br>Soundex is coarse even for English. I&#39;ve found the atrocious example that<br>
the Soundex for &quot;Britney Spears&quot; is the same as for<br>&quot;bewährten Superzicke&quot; (~ &quot;proven super-b*&quot;).  <a href="http://en.wikipedia.org/wiki/New_York_State_Identification_and_Intelligence_System" title="New York State Identification and Intelligence System">NYSIIS</a> is supposed<br>
to be better.<br><br>For German, there is an equivalent: &quot;Kölner Phonetik&quot;. It might<br>make sense to provide this for an operator &quot;soundex[de]&quot;. (All of<br>/M[ae][iy]e?r/ sound alike in German, and all exist as proper names.)<br>
<br>I have also found one link to an implementation adapted for French. <br><br>Soundex is aimed at the pronunciation of proper names. There might be some<br>leeway for that even in a language like Hungarian, which is pronounced exactly<br>
as written.<br><br>I think Drools should drop the MVEL version and go for a flexible approach,<br>possibly even <a href="http://s.th">s.th</a>. better than Soundex/NARA for English. I&#39;ll research this<br>some more, and report back before I commit anything ;-)<br>
<br>-W<br><br><br>&gt; If so, perhaps having it in the drools codebase makes sense<br>&gt; and opens the way for people to plug in their own soundex. <br>&gt; On Mon, Oct 11, 2010 at 2:54 AM, Wolfgang Laun &lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;<br>
&gt; wrote:<br>&gt;&gt;<br>&gt;&gt; The implementation of &quot;soundslilke&quot; is broken in more than one respect.<br>&gt;&gt; The conversion of a word to a Soundex string is provided by<br>&gt;&gt; org.mvel2.util.Soundex.<br>
&gt;&gt; (.) There are words where Soundex.soundex returns null, so that the<br>&gt;&gt; calling code, in Drools, crashes with a NPE.<br>&gt;&gt; (.) The algorithm implemented in Soundex is erroneous. I&#39;m not sure which<br>
&gt;&gt; Soundex algorithm it is supposed to implement, but it just doesn&#39;t meet the<br>&gt;&gt; basic requirements.<br>&gt;&gt;<br>&gt;&gt; I have implemented, correctly, the version for the National Archives and<br>
&gt;&gt; Records Administration (NARA) rule set for the official implementation of<br>&gt;&gt; Soundex used by the U.S. Government.<br>&gt;&gt;<br>&gt;&gt; Do we wait for MVEL to correct this bug, or do we just replace it with a<br>
&gt;&gt; correct implementation?<br>&gt;&gt;<br>&gt;&gt; Regards<br>&gt;&gt; Wolfgang<br><br>