-
-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Skill: Definitions lookup #279
Comments
This is a duplicate of #200. I am currently working on coding this skill and hope to have a pull request out sometime soon. 🤞 |
Ok, Hopefully have a slimmed down version just for quick definition lookups. The entire point for me is to have a hands free way to simply ask for a definition very quickly as I'm reading. Ideally it would work with foreign words. I have many dictionaries but having to take the time to type in and read the words slows down the entire process of reading the book. I'm not sure if something like one of those can be integrated into dicio itself where it can simply look up the word and say it's definition(s). E.g., maybe one can install a definitions text(e.g., one of the free ones such as from freedict: https://freedict.org/) or use an online source(e.g., http://freedictionary.org/) Then one can change the language with a command such as: "Set Dictionary English " and then "Definition " and it will take the English word and give the definition in French(There are TTS libraries that might help with pronunciation them correctly. The best I've seen is the ReadEra TTS which are based off the google TTS stuff IIRC but one can download them) |
I was planning on using the https://dictionaryapi.dev/ API. Mainly, so that it is lightweight. (And easy to implement. 😀 ) Unfortunately, it is only for English. I have looked into other languages, but not much luck yet... |
@Stypox Do you have anything to add to this? Does it sound good to you? Thanks! |
I have something to add that may not be directly related: You should be able to add custom commands relatively easy: Basically STT->Match to custom command->Execute command. I'm not sure how useful it is with android but you could enable launching activities, opening files, etc. I haven't thought about it much but just thought it might be a useful generality for the app which if it could be done well might be quite useful. In general, it would be nice to potentially have some way to automate things and then launch them with STT commands. Again, I don't know enough about android to know how useful this could be. But say, you could enable launching python, bash, java, or kotlin scripts/code that take arguments which are passed to it through STT. Then one can write these scripts to do whatever they way more or less. This enables much more generalization of the app than having to hard code everything(which will never be able to satisfy everyone's needs/desires). The downloadable dictionary stuff should be easy: E.g., with freedict you can download many language files. This is from eng->pol and is in the .dict format which is just plain text that looks like: abominable /əˈbɒmɪnəbəl/
So basically you just look up the word in English(that is not indented) and then the definitions come afterwards which you would just read with TTS. [to speed up searching you can use a binary search since obviously the file terms are in alphabetical order] So the basic idea is:
import android.speech.tts.TextToSpeech tts!!.speak(text, TextToSpeech.QUEUE_FLUSH, null,"") So basically it's pretty simple but just a lot of wiring up. With the TTS you can then do more like even have it read back articles and such and even go into more like using voice to navigate sorta like screen readers. E.g., "Search google for " then it returns the search and you can read off the headers and then "Stop and open" and it will open the last one it spoke and then open that site and start reading it or read the summary google gives or whatever. Using the TTS should be pretty simple for definitions though. You already have the ability to convert the STT so it's really just all plumbing and then polishing. You could even then add an AI feature where you wrap some AI and let one put in the prompt using STT then read the AI output using TTS and basically have something like Siri but more useful. Maybe use deepseek. |
@Inhishonor sorry for the late reply. I think using an API is fine as an initial implementation, however it would be good if it supported multiple languages. The dictionary-files implementation could come as a community-maintained skill once there will be a way to install skills as plugins. One issue I see with this skill is that the STT will not be able to understand a word in another language, so users will have to type it in manually. To make the skill more powerful, you could compile a list of all possible language names and their variations (e.g. English, French, German, Italian, ...), so that the assistant is able to understand "what is the definition of ... in French". |
I will work on this and see what I can do. Thanks! |
"I cannot complete your request"
It would be nice if Dicio could give us the meaning of words(and read them back).
E.g., if I'm reading a book and don't know a definition it would be nice if I could quickly look it up as fast as possible. Also, for multiple languages:
E.g.,: "Definition in French beaucoup" and it recites the definition out loud.
The text was updated successfully, but these errors were encountered: