-
Notifications
You must be signed in to change notification settings - Fork 9
rvsandeep/T9Implementation
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
T9 Algorithm & GUI Author: Sandeep R.V email: [email protected] My Thoughts on Implementing T9 Algorithm What T9 is? (in short) 26 characters(A-Z) are mapped to 9 digits(1-9) to make short messaging service easier. Input: Sequence of digits Output: meaningful word/words,first word shown based on the frequency of usage of the word Example: Input: 463 output: god Input: 4663 Output: good , gone , home , goof , hoof . What i Have? Dictionary.txt . Some Cases: 1. Input as given above is a sequence of digits of a meaning full word and is known (present in the dictionary). 2. Input is a sequence of digits of a word not known. Example: 62 => this can be na , ma , oa which in turn are prefixes of words like map, math,name , oath etc. 3. Digits in the words are used as it is. Example: t9 => 89 Output: 1. Incase the sequence maps to a single word print the word. else provide the list of words used in frequently used first format. 2. Provide a list of words with prefix as entered word. This is tough in case of T9 Dictionary since the words formed by using sequence of digits is unknown. How to implement? 1. Convert words in dictionary to its numeric form. good => 4663 2. Map the digits to a Priority queue(Heap) with frequent word used as the highest priority. 3. Input digit sequence is used to get the word at the root of the tree. This solves only the case 1 where a known sequence is entered. To implement case 2. I can use a prefix tree (Trie) for all words in dictionary. OR I can search for the key which has this sequence as its prefix. (i have implemented this in my algorithm) T9GUI The interface for T9 consists of mobile like text area and 12 buttons (0-9,*,#). on pressing the buttons the corresponding letter should come on the text area. On pressing 0,word corresponding to the previous new sequence should be appended to the previous message and space should be provided. On pressing * the next word corresponding to the sequence should be provided as an option. [DONE] T9 implmentation. A static Dicitionary is built. Queries are answered properly. T9GUI. A Simple looking and a working one. How to Use? Run the GUI. Use it just like the normal mobile keypad for typing words. Press 0 for space * for other words. What could go wrong? If an sequence is provided which is not present in the dictionary and is not the prefix of any other sequence in the dictionary, then exception is thrown. GUI stops working. Rerun to use. [TODO] 1. Right now im using the frequency count as the number of occurances of the word in the dictionary (Just to have the same experience when using mobile). It should be changed to number of times it is used by the user. 2. Word Prediction/Completion to be Implemented. 3. Option to add words to the dicitionary (make it a Dynamic Dictionary). This should also solve our problem of GUI crashing when sequence is not present and is not prefix of any other words in the dict. 4. Interface can be improved to provide edit option. 5. Capital cases can be provided, after a preiod. 6. Try to underline the word being added. 7. Take inputs from the keyboard.
About
T9's objective is to make it easier to type text messages. It allows words to be entered by a single keypress for each letter.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published