1 / 28

Autocomplete Based on Ternary Search Tree

Autocomplete Based on Ternary Search Tree. Niu Wenhao , Lu Yan, Wang Sangtian. Part 1. Motivation and Introduction. ——By Niu Wenhao. Motivation. Motivation To improve the performance of autocomplete function of Acemap. Original autocomplete function.

Download Presentation

Autocomplete Based on Ternary Search Tree

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Autocomplete Based on Ternary Search Tree NiuWenhao, Lu Yan, Wang Sangtian

  2. Part 1 MotivationandIntroduction ——ByNiuWenhao

  3. Motivation • Motivation • ToimprovetheperformanceofautocompletefunctionofAcemap.

  4. Originalautocompletefunction • Therearesomeproblemsinoriginalautocompletefunction. Largememorycosts Redis Veryslowforsomekeywords

  5. Oursolution • TernarySearchTree(TST)

  6. Demo • Demo • 202.120.36.137:8123/Autocomplete_v1.5 • ReturnaJSON

  7. JavaWeb • JavaWeb • Environment:JavaSEDevelopmentKit8.0 • Server:ApacheTomcat7.0 • IDE:Eclipse

  8. JavaWeb Server Request JSP Page Servlet Response

  9. Part 2 DetailsaboutTST ——ByLuYan

  10. Ternary Search Tree • Assign a character to each node. • Give each node three links: • Left link if key’s next character < node’s character • Middle link if key’s next character == node’s character • Right link if key’s next character > node’s character

  11. After inserting “sam” s a s a w a m l d m p s e

  12. After inserting “sam”, “sad” s a s a d w a m l d m p s e

  13. After inserting “sam”, “sad”, “sap” s a s a d p w a m l d m p s e

  14. After inserting “sam”, “sad”, “sap”, “same” s a s a d e p w a m l d m p s e

  15. After inserting “sam”, “sad”, “sap”, “same”, “a” s a s a a d e p w a m l d m p s e

  16. After inserting “sam”, “sad”, “sap”, “same”, “a”, and “awls” s a s a a d e p w a m w l d m p l s e s

  17. Performance

  18. KeepTSTinmemoryforever. • KeepTSTinmemoryforever. • Veryimportant! • BuildaTST:longtime • SearchinTST:nomorethan1ms

  19. Part 3 Improve user experience ——ByWangSangtian

  20. Improve user experience • Sorry, I type in wrong prefix! • What’s your middle name? • What about abbreviation? • They have same name…… • Useless data in database.

  21. Sorry, I type inwrong prefix! • Users may type in wrong prefix. Xinbing Wang xinbing xinbnig Wrong xinbiing

  22. Sorry, I type wrong prefix! • Exhaustion method • Exchange adjacent characters xibnnig xinnbig xinbnig xinbing xinbngi

  23. Sorry, I type wrong prefix! • Exhaustion method • Delete one character xibiing -- delete “n” xiniig -- delete “b” xinbiing xinbing -- delete “i” … --delete “i”, “n”, “g”

  24. What’s your middle name? • Some users don’t know the author’s middle name.

  25. What about abbreviation? • Users are more familiar with abbreviations of affiliations.

  26. They have same name… • There are 16 authors named “Tao Wang” in our database. tao wang:7D1EAAC6 Name + ID tao wang:7DAE408A tao wang:7DC34BA9

  27. Useless data in database • There are some useless data in database.

  28. Q&A

More Related