I came across this the other day: <a href="http://en.wikipedia.org/wiki/Levenshtein_distance">en.wikipedia.org/wiki/Levenshtein_distance</a><div><br></div><div>while not directly related - it is in the general area of what we are trying for here - which is to deal with input has come from a human who made small typos (the above could help if you have a modest size dictionary you can score against for best match - obviously small as it is probably quadratic time to find a match).<br>
<br><div class="gmail_quote">On Sat, Oct 16, 2010 at 5:07 AM, Wolfgang Laun <span dir="ltr">&lt;<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
What you describe isn&#39;t an issue of providing a built-in operator that maps both<br>
operands according to &quot;any kind of processing&quot; before doing == or !=.<br>
<br>
Nevertheless, if anyone thinks that DoubleMetaphone is worth doing, it<br>
could be added to the framework class I&#39;ve outlined in my original mail.<br>
<font color="#888888"><br>
-W<br>
</font><div><div></div><div class="h5"><br>
On 15 October 2010 18:11, jschmied &lt;<a href="mailto:nabble@juergenschmied.de">nabble@juergenschmied.de</a>&gt; wrote:<br>
&gt;<br>
&gt; Hi!<br>
&gt;<br>
&gt; I would put the creation of the key into a getter of my dataobject like:<br>
&gt;<br>
&gt; class MyObject {<br>
&gt;<br>
&gt; public String getMatchingKey() {<br>
&gt;  return doubleMetahone(myValue);<br>
&gt; }<br>
&gt; }<br>
&gt;<br>
&gt; then insert this object into the working memory. You can write then your<br>
&gt; rules like:<br>
&gt;<br>
&gt; $a : MyObject ()<br>
&gt; $b: MyObject(MatchingKey == $a.MatchingKey)<br>
&gt;<br>
&gt; Drools calls the getMatchingKey only once and caches the result!<br>
&gt;<br>
&gt; You can hide any kind of processing in a getter. As example I&#39;ve done many<br>
&gt; Date/Time processing like this.<br>
&gt;<br>
&gt; juergen<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; View this message in context: <a href="http://drools-java-rules-engine.46999.n3.nabble.com/soundslike-report-on-phonetic-matching-tp1707485p1709303.html" target="_blank">http://drools-java-rules-engine.46999.n3.nabble.com/soundslike-report-on-phonetic-matching-tp1707485p1709303.html</a><br>

&gt; Sent from the Drools - Dev mailing list archive at Nabble.com.<br>
&gt; _______________________________________________<br>
&gt; rules-dev mailing list<br>
&gt; <a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
&gt; <a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
&gt;<br>
<br>
_______________________________________________<br>
rules-dev mailing list<br>
<a href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-dev" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Michael D Neale<br>home: <a href="http://www.michaelneale.net">www.michaelneale.net</a><br>blog: <a href="http://michaelneale.blogspot.com">michaelneale.blogspot.com</a><br>

</div>