xuchunyang / osx-dictionary.el

Mac OS X Dictionary.app interface for Emacs
139 stars 23 forks source link

Several new experimental features: #4

Closed agentcoops closed 9 years ago

agentcoops commented 9 years ago

I wouldn't recommend actually merging yet as I'm still developing, testing and cleaning up the code for these features, but, since you appear to be actively working on this plugin, I wanted to see what you thought.

Dictionary choice relies on an undocumented API call so it could be unstable, but it is something that I very much need since I work often between, for example, French and English and "porter" appears in both dictionaries. That said, I understand if you don't want to include this in the distributed version of the library since, again, it includes undocumented API calls.

The logging, however, is something you list in your TODO, so I of course assume that it is a feature you are more apt to accept. Note that my implementation is very rudimentary and I will be continuing to expand in the next few days---please let me know if there's anything that would be especially useful for you, here. My plan is to further develop or incorporate a flash-card mode atop this output to help with language learning.

xuchunyang commented 9 years ago

Thank you very much for this.

The ability to explicitly choose which dictionary to use by setting 'osx-dictionary-dictionary-choice.

This feature is very useful. At the beginning of writing osx-dictionary.el, I tried to implement this by using DictionaryKit, but it didn't work very well, program crashed when I tried to access some dictionaries. And my knowledge of Objective-C is very limited, so I can't figure out what's the problem.

The ability to log all items a user has searched for.

I do have a plan for this. I still don't implement this because I don't know how to use the searching history.

agentcoops commented 9 years ago

Oops, cleaned up those two points.

Today I was hoping to put in a bit more time on the logging. I was thinking of using org-mode as a bit of a light-weight and searchable, but still human-readable database. After making that change, http://orgmode.org/worg/org-contrib/org-drill.html could be used off the shelf to quiz a user on their search history. I eventually want how often a given word is searched for to impact how often it comes up in flash card training sessions. The ability to export to Memrise or any other mobile flash card app would be great.

One thing that would be nice is actually integration with google-translate. My ideal is to highlight a sentence, possibly annotate a couple words, and have the whole sentence run through google translate, the annotated words searched in the dictionary, with flash-cards added for each word that include the searched sentence as an example use. Does that make sense? I see you already include a few other dictionary services, but at a certain point it might make sense to take out logging and all references to non-dictionary.app dictionaries from this library in order to create a higher-level library that handles logging and integration of multiple dictionary services...

My longterm aim, here, is a decent translation/language-learning environment within emacs.

xuchunyang commented 9 years ago

Oops, cleaned up those two points.

Thanks for this improvement. There is an issue with your commit message: you didn't leave the second line blank to indicate the first line is the summary, please see https://github.com/erlang/otp/wiki/Writing-good-commit-messages for more info. Since I have merged your PR, I will fix your commit messages.

xuchunyang commented 9 years ago

Today I was hoping to put in a bit more time on the logging. I was thinking of using org-mode as a bit of a light-weight and searchable, but still human-readable database. After making that change, http://orgmode.org/worg/org-contrib/org-drill.html could be used off the shelf to quiz a user on their search history. I eventually want how often a given word is searched for to impact how often it comes up in flash card training sessions. The ability to export to Memrise or any other mobile flash card app would be great.

After we figure out where / how to use the logging, it's easy to be implement. I will try org-drill tomorrow.

One thing that would be nice is actually integration with google-translate. My ideal is to highlight a sentence, possibly annotate a couple words, and have the whole sentence run through google translate, the annotated words searched in the dictionary, with flash-cards added for each word that include the searched sentence as an example use. Does that make sense?

https://github.com/atykhonov/google-translate can be used to translate an sentence or look up a word, but the whole workflow as you said seems complicated.