Deliverable-3
Objective
Incorporate the functionality of autosuggestion of english dictionary words in
Yioop
Details
In the previous deliverables, a Trie of english dictionary words was constructed.
Using the .gz file of JSON Trie, a javascript is written to extract the words
for autosuggestion in Yioop
- The Trie is loaded while the website is launched
- Every time a key is up in the search box, words are retrieved and displayed
- Only top 6 words are displayed
- The user can hover the cursor on the autosuggestion results and click one
of them to place in the search box
- This currently works only for the first word
Components of Yioop updated
- search_view.php - Added src for new JS file
- web_layout.php - Additional properties to input tag and new div for
dropdown
- scripts folder - Added new JS file
- search.css - To style the dropdown
- resources folder - To place the Trie file
High frequency word list
The words were obtained from list of 50K high
frequency english words. This contains a tuple of word + frequency of its occurrence. Using an awk script, the file was filtered to just have the english words and later used to build a Trie.
After incorporating autosuggest into Yioop, it looks something like below. This
image shows the dropdown for single character entry 'c'.
For a search term of more than one character, it looks something like below.
After intended word is seen in the dropdown, the user can click it and select,
to place it in the search box.
One more example can be seen below.
References
[1] http://invokeit.wordpress.com/frequency-word-lists/
[2] w3schools.com
|