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"><<a href="mailto:wolfgang.laun@gmail.com">wolfgang.laun@gmail.com</a>></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't an issue of providing a built-in operator that maps both<br>
operands according to "any kind of processing" before doing == or !=.<br>
<br>
Nevertheless, if anyone thinks that DoubleMetaphone is worth doing, it<br>
could be added to the framework class I'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 <<a href="mailto:nabble@juergenschmied.de">nabble@juergenschmied.de</a>> wrote:<br>
><br>
> Hi!<br>
><br>
> I would put the creation of the key into a getter of my dataobject like:<br>
><br>
> class MyObject {<br>
><br>
> public String getMatchingKey() {<br>
> return doubleMetahone(myValue);<br>
> }<br>
> }<br>
><br>
> then insert this object into the working memory. You can write then your<br>
> rules like:<br>
><br>
> $a : MyObject ()<br>
> $b: MyObject(MatchingKey == $a.MatchingKey)<br>
><br>
> Drools calls the getMatchingKey only once and caches the result!<br>
><br>
> You can hide any kind of processing in a getter. As example I've done many<br>
> Date/Time processing like this.<br>
><br>
> juergen<br>
><br>
><br>
><br>
><br>
><br>
> --<br>
> 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>
> Sent from the Drools - Dev mailing list archive at Nabble.com.<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>
><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>