Notices


Reply
Thread Tools
Posts: 68 | Thanked: 36 times | Joined on Dec 2009
#1
This is a proposal for a new feature for integrating tomotko (flash-card application for learning foreign languages) with a dictionary application (presumably qstardict).

Initial discussion on this feature was on the package testing page for tomotko.

The basic idea is that when I look up a word in the dictionary, I can press a button in the dictionary app to have it added to a tomotko glossary. This way I can later run a quiz in tomotko on all the words I recently looked up.

Let's start with 2 use cases.

Amy has studied a little french, and is staying in france for a short holiday. While she is there, she uses Qstardict with a french-english dictionary to look up words she encounters. She clicks on the button for adding these words to the glossary. Once she gets back home, she can run a quiz in tomotko to practice all the words she learned during her trip.

Paolo speaks german at an advanced level, but wants to improve. He is reading a book in german, and using qstardict to look up words in a German monolingual dictionary. For each word that he thinks is worth remembering, he presses the button to add it to the glossary. Later he can practice all the words he recently learned with a tomotko quiz.

In both cases, manually adding each word to the glossary would require at least 2 cut&paste operations. it's not much, but enough to make it impractical in many situations, such as standing in a street during a trip, or looking up tens of words when reading a 500-page book.
 

The Following User Says Thank You to feydrutha For This Useful Post:
Posts: 68 | Thanked: 36 times | Joined on Dec 2009
#2
replying to myself with the initial answer from Frederic Bergeron, the tomotko developer:

Other people have asked this feature before as you can see here:

http://groups.google.com/group/zbedi...750d185da82af0

First, I would need to implement an interface to toMOTko that would accept input from external application. I have never done that but I think it's possible using QCop channel in Qt.

Then, your dictionary application would need to be updated as well to interoperate with toMOTko.

And finally, the hardest part, is for toMOTko to make sense of what it will receive from the external application and guess correctly to organize the data accordingly. Because toMOTko's data structure for a term/word is:

firstLanguageTerm testLanguageAlt testLanguageTerm firstAndTestLanguageComment

So assuming that the input from Qstardict is a text like:

cat: [kat] -Noun: 1. a small domesticated carnivore, Felis domestica or F. catus, bred in a number of varieties. 2. any of several carnivores of the family Felidae, as the lion, tiger, leopard or jaguar, etc. 3. Slang. a. a person, esp. a man. b. a devotee of jazz.

-Verb: 1. cat around, Slang. a. to spend one's time aimlessly or idly. b. to seek sexual activity indiscriminately; tomcat.

This is just an example. The textual data could vary significantly from a dictionay to another. And that's the problem... How can toMOTko guess what is the firstLanguageTerm, testLanguageAlt, testLanguageTerm, firstAndTestLanguageComment?

This is not trivial. Actually, I have no acceptable solution for that at the moment. That's why the feature have never been implemented.

The easiest way would be that the interoperating applications decide on a common protocol. This would require to update both applications though. So toMOTko would have a very specific interface like: addTerm( firstLanguageTerm, testLanguageAlt, testLanguageTerm, firstAndTestLanguageComment ) and Qstardict would transmit such a service call in the air whenever a lookup is performed. As Qstardict is probably aware of its data structure, it would be in a better position to guess what is firstLanguageTerm value, and so on.

If you have suggestions, please enlighten me. I think we should discuss that either by email or on the public forums of toMOTko on the SourceForge page or make a new thread in Maemo forum.
 
Posts: 68 | Thanked: 36 times | Joined on Dec 2009
#3
Ok, I now have tested tomotko a little bit. I wasn't quite able to use it on the n900 because of this bug. So I tried the linux version on my laptop a bit.

I also looked at the stardict data format. There is a binary format that is quite complicated. However, this howto on creating your own dictionary gives an idea of the structure of the information. Basically, stardict has simple pairs entry->meaning of entry. The meaning of the entry could be a translation (if it is a multi-lingual dictionary), or an explanation in the same language (for mono-lingual dictionaries). Stardict does not know if the dictionary is multi-lingual or not: it just shows you the text for the entry you look up.

I tried adding a word to tomotko by cut and paste from qstardict. I pasted the word I looked up in the first language box. Then I pasted the entire dictionary entry for that word (several lines, this is a mid-sized mono-lingual dictionary) into the comment box. This seems to work. I had to use the comment box because the other boxes are rather small, and the word did not show up properly in the word list if it had a multi-line translation.

So, in conclusion, I could imagine some kind of API in tomotko that allows other applications to add words. Or, alternatively, a libtomotko library allowing other applications to edit glossaries independently of tomotko. On the Qstardict side, a button could be added to the GUI (maybe through a plugin? not sure if qstardict supports plugins). There is some room in the current GUI next to the speak button.

Then we would have to decide which glossary to add to: I suppose a "current glossary" could be selected through the menus. Finally, which fields get written to when adding files to a glossary. I suppose tomotko could provide functionality to add all 4 fields:

firstLanguageTerm testLanguageAlt testLanguageTerm firstAndTestLanguageComment

and the dictionary application would just leave some of them empty. Qstardict could set testLanguageTerm or testLanguageAlt (not sure what the difference is between the two) to the first line of the dictionary entry, and firstAndTestLanguageComment to the whole entry.
 

The Following User Says Thank You to feydrutha For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 11:19.