Also, there is strsim: <a href="http://mvel.codehaus.org/String+Similarity+Check">http://mvel.codehaus.org/String+Similarity+Check</a><br><br>so you can do <br><br>Something( eval( (field strsim "blah") > 0.9
) )<br>(or something like that anyway - to look for similarity rating). But I think soundex is what you really want. <br><br><div><span class="gmail_quote">On 9/4/07, <b class="gmail_sendername">Michael Neale</b> <<a href="mailto:michael.neale@gmail.com">
michael.neale@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Hi Irving. That is a very interesting and kind of cool problem.
<br>Happily, Mike Brock who built MVEL, which is part of drools, embeded soundex into it.<br><br>So you can do (and I just tried this):<br><br>rule "Hello World"
<br> when<br> c : Cheese( eval(type soundslike "foobar") )<br> then<br> c.setPrice(42);<br>end<br><br>And it will match "Cheese" with a type of "fubar" as well. Using soundex standard. You could of course use a function to use some other library that you want, but this is built in.
<br><br>Note the use of "eval" inside the pattern to indicate it is an expression, not a field constraint. <br><br>Hope that helps !<br><span class="sg"><br>Michael.</span><div><span class="e" id="q_114cec469fe32731_2">
<br><br><div><span class="gmail_quote">On 9/4/07, <b class="gmail_sendername">
Irving Reid</b> <<a href="mailto:irving@cfrq.net" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">irving@cfrq.net</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I have a use case where we'd like to match free text strings, with words sometimes spelled incorrectly. Has anyone tried Drools with an approximate string matcher (
<a href="http://en.wikipedia.org/wiki/Approximate_string_matching" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://en.wikipedia.org/wiki/Approximate_string_matching</a>)?<br><br>I know that I can use regular expressions to match some common spelling errors, but it would be way cool to use an algorithm that doesn't need to have all the possible errors programmed in beforehand.
<br><br> - irving -<br><br><br><br><br>_______________________________________________<br>rules-users mailing list<br><a href="mailto:rules-users@lists.jboss.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
rules-users@lists.jboss.org</a><br><a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
https://lists.jboss.org/mailman/listinfo/rules-users</a><br></blockquote></div><br>
</span></div></blockquote></div><br>