27 September 2010

Kamous, the C++/Qt dictionary

Last week, I needed to have my own desktop Java dictionary to be mush faster, so I decided to port it in C++.

So, I decided to re-write it in C++/Qt.
I hardly do that (since I am new both C++/Qt), and put it as a project at Google code.

I named it Kamous, you can find it here:
http://code.google.com/p/kamous/

(Kamous for KDE, hopefully to be adapted by any Arabic-oriented Linux distribution)

It is good to mention that, I am using the Arab Eyes wordlist.

23 comments:

Anonymous said...

nice, can i ask you some questions

QT is same like C++ with just changing libraries and some constants of the language???

please answer me....

XMasterrrr from arabteam

Mohammed Hewedy said...

:), hey bro
Qt is just a bunch of libraries (not a programming language).
Qt is built on top of C++ (and other languages)

If you know C++ well, it is very easy to learn a bunch of new libraries (either Qt or others).

Qt provide libraries for GUI, DB processing, XML, openGL and others, go to their web site for more info.

Note: I am very very new to Qt (it is my first program)

Anonymous said...

nice to meet you :),

thank's for answering my question

i thought that's qt have some more changes than libraries

oh.... ah then the libraries just like iostream which control cout and cin the QT libraries have other control structure

iam right ???

other question pointers is easy in c++ ?????

thanks....

XMasterrrr (Ahmed Magdy)

Mohammed Hewedy said...

@Xmsterrr,
1- ya, somewhat.
2- when I first study it, it wasn't that easy.... to to read about it from different resources.

Anonymous said...

thank's bro

see you....

مهدي حجازي said...

I am sure I'll check ii, wish you the best Hewedy. I like your movement from Java to C/C++, I wish I could do that also, wish me Luck my dear friend :D.

Mohammad Nabil Al-Aggan said...

السلام عليكم
جزاك الله خيرا على هذه المجهود
لكن الكود ليس موجودا في صفحة المشروع
I believe you didn't commit your latest version

SalehRam said...

Hi dude,

Nice work :-D

You've beaten me with an open source project online :-D

I have a question regarding you & C++ & Linux, how is your level with it? can you write complicated stuff? :-D
Your answer will determine my next Q :-D

Good Luck,

Mohammed Hewedy said...

@مهدي حجازي
Thanks bro, looking forward to hear your comments.

Actually I am not moving from Java, I just try to do what I like in spare time!

How hard if we need to convert it to a mobile app?

@Mohammed Nabil
و عليكم السلام..
و جزاك أخي محمد.. حقيقة أنت دائما من تشتجعني بمجهوداتك..
أنا رفعت الكود كمرفقات ...
و هو موجود هنا:
http://code.google.com/p/kamous/downloads/list

@SalehRam
I am an old Linux user, with a background in C that I can consider it as a Good background.
unfortunately, I don't know much about C++, but I think I can :).

Mohammed Hewedy said...

@mohammed nabil

I have committed the source code:

http://code.google.com/p/kamous/source/browse/#svn/trunk

مهدي حجازي said...

Thanks, it is better to use SVN :D. I checked the code, you almost have a standard C++ project not Qt :(, thats will cause a lot of headache to port to Symbian. It will be easier if you wrote it with Qt only. Anyway I'll be happy if you let me try to port it on my free time?

Mohammed Hewedy said...

Yea, it is written in C++ with very little Qt just for GUI.
I'll be happy if you do porting it.

Thanks bro Mahdi :)

مهدي حجازي said...

Hi Hewedy, I complete the initial port. how do you like me to share the code? Can you give me access to your project or should I create a new fork of your project on google codes?

The second problem is that application couldn't run on the phone. We need to optimize it, now if I load only two characters the application will open correctly but if I load the whole characters the application can't run. Can we talk about optimizing the performance.

Thanks, your brother
Mahdi

Mohammed Hewedy said...

@mahdy

I'll be more than happy if give you access to the project, just give me your gmail email address.

If you feel it will be better if you create a new project/clone, I will be OK too.

About the performance problem, you can do a trick, which to load files on demand (and cache them then)
As, you will not load any files at start-up at all, and when the user enters the word "Hello", we load the File `H`, and possibly can cash it for later usage. and so on. What do you think about that?

مهدي حجازي said...

thanks, here is my email: mahdi.hijaz@gmail.com, I think it is better to add it on your project and so we can organize it later easily and may be we could crate one code to run on both windows/linux and Symbian after we solve the problems in the my code.

regarding your suggestion, I'll try it

مهدي حجازي said...

Hi, sorry to bother you, but now I got time that I may not have later :). The application opens after I tried your suggestion but it is horribly slow on some characters. I think the problem appears because of the way we index the files, for example the "S" characters has a 279 KB file, but the "X" has a 6 KB file which is so fast. We should index the files so all files have the same size, what you think?

Mohammed Hewedy said...

@mahdy

I've added you to kamous at google code.

About the performance problem:
Does search for a word starts by S is very slow all the time? or just when searching the first word starts in S?

I can understand from you reply that whenever we search a word that starts by S, we get speed problems!

So, what about if we divided the large files into group of related files, and do something like:

if (word >= "s" && word < "seek")
go to file s_1
else if (word >= "seek" && word < "speak")
go to file s_2
else if (word >= "speak")
go to files s_3

For other small files (like X) we will leave as is.

The above is not the good way of thinking, it is just a brute force approach, we need to think more better.

What's your input for such a problem?

Thanks Mahdi for you effort!

مهدي حجازي said...

As this page is getting too long, lets continue our work via emails, so please check your email.

Regards,
Mahdi

Mohammad fathei said...

thanks bro hewedy for sharing your knowledge and ur good projects

but i ask u a small request,
can u share it as java project on GOOGLE too, or here in ur blog

that is only if u don't have any objetion !

thanks again

your bro
Mohammad fathei

Mohammed Hewedy said...

@Mohammed fathi:
You are asking about the Java version of the program?

mohammed fathei said...

yes i'm

i just want to see ur idea
to get the translation from the data files

thanks

Mohammed Hewedy said...

Okey bro.. the Java version is not at my hand now, but you can read this topic:

http://m-hewedy.blogspot.com/2010/01/controlling-your-java-command-line.html

I've put the idea behind the translation process here...

mohammed fathei said...

thanks bro
i think it's enough