tag:blogger.com,1999:blog-7583720.post8801137718908922255..comments2024-03-05T03:17:02.289-08:00Comments on Salmon Run: Three Autocomplete implementations comparedSujit Palhttp://www.blogger.com/profile/06835223352394332155noreply@blogger.comBlogger21125tag:blogger.com,1999:blog-7583720.post-19348608680818704202019-03-18T01:20:03.326-07:002019-03-18T01:20:03.326-07:00good..good..sachinhttps://buybestmassagechair.com/best-rock-tumbler/noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-38278600055361915852017-05-23T17:28:06.125-07:002017-05-23T17:28:06.125-07:00Thank you, Bo, you are right, I have updated the c...Thank you, Bo, you are right, I have updated the code.Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-61859665235665608992017-05-18T11:25:13.020-07:002017-05-18T11:25:13.020-07:00Line 5 should be: trie.load(line);Line 5 should be: trie.load(line);Bo Mengnoreply@blogger.comtag:blogger.com,1999:blog-7583720.post-76150585287292261142016-01-07T07:49:45.889-08:002016-01-07T07:49:45.889-08:00The JDBC and Set approaches could be modified to d...The JDBC and Set approaches could be modified to do what you want, although the behavior may turn out to be non-intuitive.Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-86617325700971868882016-01-07T04:55:09.343-08:002016-01-07T04:55:09.343-08:00Is there an option to tweak the code so it will ha...Is there an option to tweak the code so it will have the possibility of returning "contains" results and not only "startsWith"?Zivnoreply@blogger.comtag:blogger.com,1999:blog-7583720.post-39027895397448839212012-12-26T04:34:35.461-08:002012-12-26T04:34:35.461-08:00@jcsahnwaldt - +1, nice improvement! @jcsahnwaldt - +1, nice improvement! Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7583720.post-43230222606945639222012-03-17T18:14:26.892-07:002012-03-17T18:14:26.892-07:00Thanks Nishikant. Would it be possible to use a Ma...Thanks Nishikant. Would it be possible to use a Map keyed off the selected node instead?Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-40840603968975335052012-03-13T03:17:21.187-07:002012-03-13T03:17:21.187-07:00The solution looks great but I have one small ques...The solution looks great but I have one small question.What if we need to have key value pair for all suggestions ?Which data structure to use where I need to store key for suggestion selected by user?<br />I tried using List but its very slow for huge amount of data.Nishikant Tiwarihttps://www.blogger.com/profile/10046496274463198491noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-39057980330044515222010-11-30T18:37:28.194-08:002010-11-30T18:37:28.194-08:00A minor improvement to the TreeSet version - if yo...A minor improvement to the <b>TreeSet</b> version - if you don't use <b>tailSet(prefix)</b> but <b>subSet(prefix, next)</b> instead, where <b>next</b> is <b>prefix.substring(0, prefix.length() - 1) + (char)(prefix.charAt(prefix.length() - 1) + 1)</b>, you can avoid calling <b>tail.startsWith(prefix)</b> in the loop. May be a little faster. Note: The construction of <b>next</b> may not work jcsahnwaldthttps://www.blogger.com/profile/05536598140736834255noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-86880719454228800122009-12-25T19:01:30.114-08:002009-12-25T19:01:30.114-08:00Thanks Shilad.Thanks Shilad.Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-80450771557968186832009-12-21T23:08:15.549-08:002009-12-21T23:08:15.549-08:00I just posted a pluggable implementation of the tr...I just posted a pluggable implementation of the tree-based autocomplete datastructure at <a href="http://code.google.com/p/autocomplete-server/" rel="nofollow">the Google Code Autocomplete-Server Project</a><br /><br />My hope is that the library will make it easier for others to efficiently integrate autocomplete into their applications. Kick the tires!Anonymoushttps://www.blogger.com/profile/17708411018536824747noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-31667285472887910082009-07-31T15:33:46.486-07:002009-07-31T15:33:46.486-07:00You are welcome, and thanks for the feedback. Glad...You are welcome, and thanks for the feedback. Glad it helped.Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-34735940337060283702009-07-31T11:17:10.080-07:002009-07-31T11:17:10.080-07:00This is an awesome review. Helped a lot, and I ha...This is an awesome review. Helped a lot, and I have used the TreeSet to blaze through autocomplete lookups.<br /><br />I made one to lookup every country, and every state in every country worldwide.<br /><br />The number of states is quite large.<br /><br />The lookup is under 2ms using TreeSets... and often 0ms.<br /><br />I added a "limit" field which is useful for ajax autocomplete Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7583720.post-39653832310752908152009-07-01T23:06:06.191-07:002009-07-01T23:06:06.191-07:00Thanks Eyal, and you are welcome. I will check out...Thanks Eyal, and you are welcome. I will check out the page for the C# version.Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-20134339111408823712009-06-27T13:49:49.931-07:002009-06-27T13:49:49.931-07:00Great post. Thanks Sujit.
For all of you C# guys, ...Great post. Thanks Sujit.<br />For all of you C# guys, I've built the corresponding equivalent of a TRIE for the .NET framework, based on this and other posts.<br />Have a look at my post here: http://metalthought.blogspot.com/2009/05/enhanced-performance-for-aspnet-ajax.htmlEyalhttps://www.blogger.com/profile/09058756407679596020noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-73166770890256920382008-03-09T10:01:00.000-07:002008-03-09T10:01:00.000-07:00Hi Tomer, thanks for the pointer to PredictAd, its...Hi Tomer, thanks for the pointer to <A HREF="http://www.predictad.com" REL="nofollow">PredictAd</A>, its a very nice product you guys have come up with. Actually, I was just curious as to how its done, and I had some ideas, which is what I tried out and wrote about on the blog. The code here <I>does</I> help people to roll their own autocomplete solutions, but the intent is not to compete with Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-66491952333435502762008-03-09T09:50:00.000-07:002008-03-09T09:50:00.000-07:00Hi Nicolai, your Suggest Tree looks really interes...Hi Nicolai, your Suggest Tree looks really interesting. I agree its probably going to scale better since you are also taking into account popularity of a given term. Thank you for the link.Sujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-49431729520996323222008-03-04T04:29:00.000-08:002008-03-04T04:29:00.000-08:00looks good but very complicating...i think predict...looks good but very complicating...i think predictad simplifies the processtomermolohttps://www.blogger.com/profile/01833832429037973262noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-47220663132771582372008-03-02T01:12:00.000-08:002008-03-02T01:12:00.000-08:00Thank you for your interesting post! It made me th...Thank you for your interesting post! It made me think about a data structure for rank-sensitive autocompletion, that is efficient for the retrieval of the top <I>k</I> best-ranking completions of a given prefix. And I came up with something I called <A HREF="http://suggesttree.sourceforge.net" REL="nofollow">Suggest Tree</A>. It is fine both in terms of time and space efficiency.<BR/><BR/>Best Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7583720.post-59965070646303422662007-12-17T02:57:00.000-08:002007-12-17T02:57:00.000-08:00Thanks Sree, I haven't done tests comparing a Trie...Thanks Sree, I haven't done tests comparing a Trie with a TreeSet for large number of elements, but intuitively, I don't think the relative numbers would change very much. With a larger number of elements, assuming more overlap in the leading chars, the Trie implementation would have to climb deeper into the Trie to get the suggestion, while the TreeSet implementation would have to scan through aSujit Palhttps://www.blogger.com/profile/06835223352394332155noreply@blogger.comtag:blogger.com,1999:blog-7583720.post-1447355021551452102007-12-12T09:58:00.000-08:002007-12-12T09:58:00.000-08:00Vert nice post. Thanks for comparing Trie and Tree...Vert nice post. Thanks for comparing Trie and TreeSet.<BR/><BR/>However, I think the Trie looked faster (about twice as fast as TreeSet) mainly because the # of files in your /tmp folder are relatively less (~280).<BR/><BR/>I wonder how the perf numbers would look if the elements are in the order of thousands. <BR/><BR/>Overall, a very useful post.<BR/>Thanks,<BR/>SreeAnonymousnoreply@blogger.com