FileDocCategorySizeDatePackage
PTDictionary.javaAPI DocphoneME MR2 API (J2ME)2712Wed May 02 18:00:20 BST 2007com.sun.midp.chameleon.input

PTDictionary

public interface PTDictionary
Interface for predictive text processing This class is responsible for initializing the Dictionary Two APIs are required, addWord : An interface to add a word to current dictionary (if supported) iterator: Get a iterator object with the following methods iterator.next() : get next possible completion string iterator.hasNext() : check if another possible completion exists iterator.nextLevel(int key) : add a char to the current completion iterator.provLevel() : backspace last char from current completion iterator.reset() : clear current completion iteratr.resetNext() : revert to first possible completion string Example of using the predictive text API: PTDictionary dictionary; PTIterator iter=dictionary.iterator(); iter.nextLevel('2'); iter.nextLevel('2'); iter.nextLevel('2'); while(iter.hasNext()) { String completion=iter.next(); System.out.println(completion); //will print "aca" (short of "academy") "cab" (short of "cabin"), // "acc" (short of "accelerate") etc. }

Fields Summary
Constructors Summary
Methods Summary
public booleanaddWord(java.lang.String word)
add a new word to the dictionary

param
word new word to add to dictionary
return
true if new word was added, false otherwise

public PTIteratoriterator()
get a iterator to the predictive text library

return
a predictive text Iterator