freedic

18
FREEDIC A SymbianOS based multilingual dictionary for the Nokia 7710 Chong Poh Kit ; Dao Yuan; SeungHyun Whang

Upload: miriam

Post on 19-Mar-2016

76 views

Category:

Documents


1 download

DESCRIPTION

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 - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: FREEDIC

FREEDIC

A SymbianOS based multilingual dictionary for the Nokia 7710 Chong Poh Kit ; Dao Yuan; SeungHyun Whang

Page 2: FREEDIC

Contents

GUI Background monitoring Classes design Loading dictionary Lookup Function Advantages Future work

Page 3: FREEDIC

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

Page 4: FREEDIC

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

Page 5: FREEDIC

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

Page 6: FREEDIC

Copying

Page 7: FREEDIC

Background monitoring Monitor for key-press events from

the background Wakes up the dictionary and puts

it to the foreground to display the text

Page 8: FREEDIC
Page 9: FREEDIC

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.

Page 10: FREEDIC

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.

Page 11: FREEDIC

Example of loading .ifo file

Page 12: FREEDIC

Load Dictionary file How is it loaded into memory?

Very important to reduce memory consumption.Data file: ( 4.3 MB)

offset=========word_1_data_1_dataword_1_data_2_dataword_2_data_1_dataword_2_data_2_data

......==============

like

1000==========apple [Apl]

A delicious fruit......

==============

Index file: ( 600 KB)

============== word_str; apple(a utf-8 string terminated by '\0'.) word_data_offset; 1000 // word data's offset in .dict file word_data_size; 500// word data's total size in .dict file......

==============

Memory-page table: (19 KB)

============== word_str; page number; page size;

==============

Memory-page: ( 560 B)

page 1========== word_str; word_data_offset; word_data_size; //64 entry per page.

==============

Page 13: FREEDIC

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 & sWordsWord, TInt32 & iWordIniWordIndexdex, TInt iLibiLib); 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.)

Page 14: FREEDIC

Lookup Function Call (Simple lookup function:)<A word is inputed for search>

<Libs> <Dict> <offset_index><AppCore::>

for (int iLib=0; iLib<oLibs.ndicts(); iLib++) oLibs.SimpleLookupWord(word, offset of that dictionary, dictionary number);

Forward the search to the corresponding dictionary

oLib[iLib]->Lookup(word, offset)

Forward the Lookup in its index file

idx_file->lookup(str, idx)

Event: A searching key word i s entered

Look up in every dictionary:

Look up the page number in page_table

Load the page into memory

Look up the entry in the page

With the offset value to DATA file, explanation can be read from it to the memory.Then, display the explanation in textbox.

Page 15: FREEDIC

Database Lookup Function Source code to lookup page table & entries within a page

while (iFrom<=iTo) {iThisIndex=(iFrom+iTo)/2; //divide the table into halfcmpint = stardict_strcmp(str, get_first_on_page_key(iThisIndex)); //comparingif (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 foundbFound=true; //mark the flagbreak; //need no more search, break the loop}}

Page 16: FREEDIC

Advantages Configurable Faster Multilingual Free dictionary files Background function Copying

Page 17: FREEDIC

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.

Page 18: FREEDIC

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.