Re: How to achieve a fuzzy match searcher
Re: How to achieve a fuzzy match searcher
- Subject: Re: How to achieve a fuzzy match searcher
- From: Gustavo Pizano <email@hidden>
- Date: Thu, 15 Oct 2009 13:06:02 +0200
Hello All.
What would be the best way to implement this, I mean,
the server where Im deploying right now its a G5, with 3 GB Ram, and I
need the fuzzy matches to be as fast as possible,
So I was
thininking to surround the textefield where the user can type with a
WOForm, and place inside a AjaxObserveField, which makes me have some
questions:
I have the follwoing in the html
<wo:form multipleSubmit = "$true">
<wo:AjaxUpdateContainer id="transTextContainer">
<div id ="newTextArea">
<wo:text value =
"$newTranslationValue" class = "descrTA" id="newTA"/>
</div>
</wo:AjaxUpdateContainer>
<div class = "button_holder" id ="modificationButtons">
<div id="addTrans">
<table>
<tr>
<td class ="butCell"
><wo:AjaxSubmitButton effect="highlight" id ="addT" class
="moreButton" value ="Add" updateContainerID ="WGInfomation" action
=""
>
<td class ="butCell"
><wo:AjaxSubmitButton effect="highlight" id ="updT" class
="moreButton" value ="Update" updateContainerID ="WGInfomation" action
=""
>
</tr>
</table>
</div>
<div id="saveTrans">
<div id="close"><wo:
AjaxSubmitButton
class="moreButton" value="Delete Selected" action=""
updateContainerID ="WGInfomation"
</div><!-- /Button_holder -->
<wo:AjaxSubmitButton id ="commit" class
= "moreButton" value= "Commit Translation Set" action =
"" updateContainerID ="WGInfomation" >
</div><!-- /modifyButton -->
</wo:form >
as
you can see the textfield its alreay surrownded by a WOForm, what
happens if I surrowunded again?. with a <WOForm action =
"" will the AajxObjeserField trigger that
method?
Second, in the fuzzyMatchesSearch method I will call the
implementation the Levenshtein Algorithm, so given an Array of stirngs
I will check each one and select jsut the ones that retturns a value of
no more than 2, (if I understood good the algorithm).
Im new to the threading thing, so, should I create a class that
implement Runnable, and in the run() method run the Levensthein
Algorithm, and from within the fuzzyMatchesSearch methohd run create
the instance of my Runnable Class and run the thread?.. or..... Im
really divagating here, you guys know much better than me so Im asking
an advice please.
Thanks tons
On Fri, Oct 9, 2009 at 3:03 PM, Gustavo Pizano
<email@hidden> wrote:
Well I don't need to be 100% exact, but let's say an 80%, Im looking at the 2 algorithms that Andri suggested, also i ERXIndexes wraps Lucene then I will take a look at also.
if I understood good, these algorigthms chech the strings and return a number which means the number of changes I have to make to make String 1 and String 2 the same. isn't it?
then becuase I will have to search in the db Table, my attack plan is to fetch first some relative data, so the NSArray<TransFromBase> containing the stirngs to compare with will be smaller, and then lopp on the array and chech each word and see the result of the algorithm, if matched some criteria then I place it in another NSArray wich will be the list to display as options for the user..
am I in the right way?
G.On Fri, Oct 9, 2009 at 2:56 PM, David LeBer
<email@hidden> wrote:
On 2009-10-09, at 8:39 AM, Gustavo Pizano wrote:
mm I have seen the ERXStringUtilities has some fuzzy matcher stuff, can somebody explain me how can (if possible) use this in my case? I dodn't get it ..
whats the fuzzymatchercleaner?
G.
On Fri, Oct 9, 2009 at 1:51 PM, Gustavo Pizano <email@hidden> wrote:
HEllo, ok this is what I need to think about:
I have a table called TransFromBase which containes slovak translations of english words/phrases , I want to allow the user to choose an option shown after he start typing a TransFromBase for a given English Phrase, Im rememebering my AI class, but I can't recall any of what I learned back there.. :P. Also because Im talking of a Table (TransFromBase) which has like 50000 records, so I need it to be as efficient as possible.
I saw a live search example shown in AjaxExamples 2, but I dunnno if this approach will help me to achieve efficiency and to be able to show in a popuplist the values... immagine when you type in Safary in the search bar, it will start displaying strings as suggestions, but I need it web based. .
Any ideas will be very appreciate it.
Thanks.
Depending on how 'fuzzy' you really need your matches to be, you might want to check out Lucene. We've had great success using it to return type ahead suggestions. Results from the Lucene index are wickedly fast.
ERIndexing in Wonder wraps Lucene.
;david
--
David LeBer
Codeferous Software
'co-def-er-ous' adj. Literally 'code-bearing'
site: http://codeferous.com
blog: http://davidleber.net
profile: http://www.linkedin.com/in/davidleber
twitter: http://twitter.com/rebeld
--
Toronto Area Cocoa / WebObjects developers group:
http://tacow.org
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden