Home | Trees | Indices | Help |
---|
|
object --+ | ternarytree.TernarySearchTree --+ | WordCollection --+ | TelPadEncodedWordCollection
Instances behave as the superclass WordCollection. However, all added words are encoded as if entered via a telephone pad. Each letter group of the telephone pad is represented by its first letter. Example: "and" --> "amd" (phone buttons 1,5,2). <p> The class can thus be used to search words by entering for each real word's letters 'c' the first letter of the telephone pad that contains 'c'. For word input, clients need not concern themselves with this encoding. That transformation occurs automatically. <p> However, calls to search_prefix() or contains() must encode the real words with the encoded version. Thus, instead of calling myColl.contains("and"), the client would call myColl.contains("amd"). Method encodeWord() takes a real word and returns the encoded version. <p> Method search_prefix() will usually contain a larger number of 'remaining possible words' than a regular WordCollection. This is because the mapping from encoded to real words is one-to-many.
|
|||
|
|||
list |
|
||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
symbolToEnc =
|
|||
encToSymbol =
|
|||
alphabet =
|
|||
Inherited from |
|
|||
Inherited from Inherited from |
|
Maintain a data structure that maps each encoded word to all the possible equivalent real words. We call these multiple words 'collisions.'
|
Prefix search operates as for the WordCollection superclass, but takes as input a telephone pad encoded prefix. Returns an array of all real words that could complete the given prefix.
|
Given a string label as seen on the JBoard button pad, return the single letter that represents the group of label chars in this class. Ex: "ABC" returns symbolToEnc["ABC"] == 'a'.
|
Given the encoding of a button label, return the original label. Ex.: 'a' ==> 'ABC', 's' ==> 'STUV'
|
Given a real word, return its telephone pad encoded equivalent.
|
Takes a real, that is unencoded word, encodes it, and inserts it into the (in-memory) tree. Updates the mapping from encoded words to their collisions.
|
Given an unencoded word, checks whether the word is already in the in-memory dictionary. If so, does nothing and returns False; Else appends the word to dict_files/dictUserRankAndWord.txt with the provided rank; then returns True
|
|
symbolToEnc
|
encToSymbol
|
alphabet
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Thu Feb 21 13:27:59 2013 | http://epydoc.sourceforge.net |