Skip to content
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

Dictionary support #9

Open
skumarudel opened this issue May 13, 2020 · 7 comments
Open

Dictionary support #9

skumarudel opened this issue May 13, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@skumarudel
Copy link

Dear,
You are doing great job!, I appreciate your effort. I have one question though:
Do you have custom dictionary support. I mean lets say I have a custom dictionary in stardict format, can I call it to lookup for words I want to while I read book in epub mode??
I have dictionary in my native language ("punjabi").
I can also help you if you like to build this feature, although I am new to app development...
Thank you in advance
Sajan

@mickael-menu
Copy link
Member

Hi Sajan,

Unfortunately we don't yet support custom dictionaries and have no plan to implement it in the foreseeable future. However, we want to make sure that it's possible for reading apps to implement it themselves without modifying Readium's codebase. So let us know if you have any issue implementing this with the current toolkit, and how we could help you there.

@skumarudel
Copy link
Author

Hi Mickael,
Thanks for your quick reply!
Let me first run your app in android studio to see if its working. Then I will get back to you. Do you think its easy to implement custom dictionary??I have no idea at this point, but I will try to read about this if you just guide me where to start. Thank you!

@mickael-menu
Copy link
Member

To be fair I'm quite new on the Kotlin side of Readium, and haven't played much with the navigators yet.

But R2EpubActivity.currentSelection() looks like it could help for that. It will give you a Locator object which should contain the selected text in locator.text.highlight.

@skumarudel
Copy link
Author

Make sense! I will try and if have any more questions I will get back to you...

@mickael-menu
Copy link
Member

I'm transferring this issue to mobile since it might also be relevant for iOS.

@mickael-menu mickael-menu transferred this issue from readium/r2-testapp-kotlin Jan 13, 2021
@HadrienGardeur HadrienGardeur added the enhancement New feature or request label Jul 7, 2024
@HadrienGardeur
Copy link
Contributor

HadrienGardeur commented Jul 7, 2024

Apple devices have native support for dictionaries, with a number of built-in dictionaries. Is this extensible in a way that allows user and/or app developers to register their own dictionaries?

On Android, I'm not aware of any native API for that. Is there a de-facto standard used as an alternative? An API? A file format?

IMO, providing a Dictionary API could make sense for Readium Mobile. It could be a wrapper on top of these native features and/or convention, but also provide additional abilities such as support for EPUB dictionaries or the ability for integrators to register their own dictionaries (through a service for example).

A Dictionary API could also work hand in hand with the Decorator API to automatically highlight that specific words have a definition available.

We tend to think about trade publishing first in the EPUB world, but this feels like a very important feature for scholarly publishing and reference works.
I've also seen a number of products in the education space that provide embedded definitions for terms that kids/students would not necessarily understand.

@brenojac is this something that you're interested in?

@mickael-menu
Copy link
Member

Apple devices have native support for dictionaries, with a number of built-in dictionaries. Is this extensible in a way that allows user and/or app developers to register their own dictionaries?

AFAIK we can't extend the native iOS dictionaries.

On Android, I'm not aware of any native API for that. Is there a de-facto standard used as an alternative? An API? A file format?

Not really, I think you can call individual apps like ColorDict with a custom Intent, and then they display the definition on top of your app. But the integration is per-dictionary app.

IMO, providing a Dictionary API could make sense for Readium Mobile. It could be a wrapper on top of these native features and/or convention, but also provide additional abilities such as support for EPUB dictionaries or the ability for integrators to register their own dictionaries (through a service for example).

I agree that having a well rounded dictionary API (as a new Readium module) supporting web services and local files would be super useful.

A Dictionary API could also work hand in hand with the Decorator API to automatically highlight that specific words have a definition available.

This is more in the realm of app logic IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants