180 likes | 382 Views
FREEDIC. A SymbianOS based multilingual dictionary for the Nokia 7710 Chong Poh Kit ; Dao Yuan; SeungHyun Whang. Contents. GUI Background monitoring Classes design Loading dictionary Lookup Function Advantages Future work. GUI. Format of Dictionary file
E N D
FREEDIC A SymbianOS based multilingual dictionary for the Nokia 7710 Chong Poh Kit ; Dao Yuan; SeungHyun Whang
Contents • GUI • Background monitoring • Classes design • Loading dictionary • Lookup Function • Advantages • Future work
GUI • Format of Dictionary file • The main GUI window will be used for users to input text and to display output for dictionary searches. • Top combobox pane : word to search • Bottom textbox: Output of search function
Buttons • Clear List • Clears the searched words list • Background • Sends the dictionary to the background but leave it running • Exit • Permanently end the dictionary session
Menu • About • A short message about the dictionary • Copy • Copy the selected text • Background • Sends the dictionary to the background but leave it running • Exit • Permanently end the dictionary session
Background monitoring • Monitor for key-press events from the background • Wakes up the dictionary and puts it to the foreground to display the text
Dictionary class design • The dictionary will be divide into following classes. • Application core class contains GUI, and it generally describes all functions of the e-dictionary. • Libs class contains all dictionaries, and it handles all the function calls from AppCore, and forward them to each Dictionary. • Dict class contains everything about a particular dictionary, the INDEX file, the DATA file, and how to lookup a key word in dictionary. • Index class only deal with index file, constructing the page table, looking up words from index and return its offset in DATA file.
Load Dictionary file • Format of Dictionary file • Contain three files - .ifo .idx .dict • .ifo file describe general information about the dictionary. # of word entries, etc. • .idx file is a index file of .dict file. It record word string and its offset in .dict file. • .dict file contain the detail translation and explanation of each word.
Load Dictionary file • How is it loaded into memory? • Very important to reduce memory consumption.
Database Lookup Function • SimpleLookup • Compare the searching word in INDEX file and than read the offset to the DATA file. • Interface of SimpleLookup Function • TBool SimpleLookupWord(TDesC & sWord, TInt32 & iWordIndex, TInt iLib); • sWord is the string of the keyword, • iWordIndex will return the offset to the DATA file • iLib will determine which dictionary to search. (Since it is will load several dictionary page table into memory.)
Database Lookup Function • Source code to lookup page table & entries within a page while (iFrom<=iTo) { iThisIndex=(iFrom+iTo)/2; //divide the table into half cmpint = stardict_strcmp(str, get_first_on_page_key(iThisIndex)); //comparing if (cmpint>0) // if the word is in second half, iFrom=iThisIndex+1; //reduce searching range by cutting first half else if (cmpint<0) // if the word is in first half, iTo=iThisIndex-1; //reduce searching range by cutting second half else { // if the word is found bFound=true; //mark the flag break; //need no more search, break the loop } }
Advantages • Configurable • Faster • Multilingual • Free dictionary files • Background function • Copying
Future work • Loading dictionary • Automatically load all possible dictionary files from the user specified directory. • For large index file (>4MB), use segmented loading method. • Change the “entry per page” according to the total number of word entry in all dictionary. • Searching algorithm • Adding rule search and fuzzy search function.
Future work • New dictionary file addition through one-click function. • Dictionary file creation code. • Camera support for dictionary search. • Support for more languages in the menu. Currently, only English is used in the menus.