Any way to integrate Pleco into Anki's "Lookup" feature?

dokoch22

Member
While I love Pleco and use it as my main Chinese flashcard studying tool. I have a couple of decks on Anki that allow me to use more multimedia (which Pleco doesn't offer as to date). Anyway, here is my question: The new Ankimobile (i.e. iphone/ipad version) allow for looking up words from 3rd party apps. In order to make it work, this is what is says in the directions:

"To look up text in another app, you need to find out if that app supports a URL scheme to call it from another application. Many dictionary applications do. For example, one of the default links is for a dictionary program called iDict+. It uses a link like:

idictplus://?search=mysearchstring&scheme=returnlink

To make this work with AnkiMobile, we would replace it with the following:

idictplus://?search={0}&scheme=anki://

* Use {0} to refer to the current text in the clipboard.
* If your dictionary app supports a "return to app" link, use 'anki://'

Another example is a dictionary app called kotoba, which uses a different lookup syntax and doesn't support passing back the return address:

kotoba://dictionary?word={0}

And one more app example:

ebpocket://search?text={0}#anki://

Unfotunately there is no consistency among apps, and no central registry of calling schemes. Thus to use your favourite dictionary app, you will need to search in google, or contact your dictionary app's author for more information."

Will this work with Anki and, if so, which lookup syntax would one use? Thanks in advance for anyones help in this matter.
 

mikelove

皇帝
Staff member
We don't support a URL protocol like that yet, no - there've been one or two requests for it, but not that much interest compared to a lot of other features on our to-do list.

But it's quite easy to do this using the pasteboard. Configure Pleco to automatically look up text from the pasteboard on launch (Settings / General / Startup Search / Insert Pasteboard and Use Reader), then highlight / copy the block of Chinese text that you're trying to look up words from, switch into Pleco (click your iPhone's home button twice and tap on the Pleco icon), and look up the word that way. The "Use Reader" option will cause the entire block of text to come up in Pleco's document reader, so you can then translate individual words by simply tapping on them without all of that tedious back-and-forth app switching.
 

dokoch22

Member
Thanks for the info. That actually works well enough. On the other hand, you may want to consider adding that feature. While Anki is sort of a competitor, each program has its own strengths and weaknesses. I'm guessing that for most Chinese students Pleco is more convenient. I know that there are a huge number of Chinese students that use Anki and this might be a good opportunity to pick up some additional business seeing that many will likely want to use it to look up words in their flashcards, etc. Just a thought....
 

mikelove

皇帝
Staff member
dokoch22 said:
Thanks for the info. That actually works well enough. On the other hand, you may want to consider adding that feature. While Anki is sort of a competitor, each program has its own strengths and weaknesses. I'm guessing that for most Chinese students Pleco is more convenient. I know that there are a huge number of Chinese students that use Anki and this might be a good opportunity to pick up some additional business seeing that many will likely want to use it to look up words in their flashcards, etc. Just a thought....
It's not really a competitive thing (there are other apps using this sort of protocol that aren't really competitors at all - RSS readers e.g.), it's more that it feels like a very awkward solution to this problem in general - we've put a lot of effort into adding our own integrated reader / flashcard / etc functions precisely because the experience is so much better that way. And it potentially creates a significant support burden on us to deal with users of these various other apps and test for / deal with those other apps' various bugs / quirks.

But the actual implementation would be very little work - particularly if we skip that "return" function - so I suppose as long as we made it totally unsupported it wouldn't do much harm.
 

mikelove

皇帝
Staff member
It looks like Anki's word lookup feature looks up whatever's in the clipboard rather than what's currently selected - is that correct? So you have to select text and tap "Copy" before you can invoke the lookup command?

If so, all we'd really need to add is the ability to launch Pleco with a URL - wouldn't even need to do anything with its contents (at least not initially) as long as you'd configured Pleco to search for the contents of the pasteboard on startup - so that should be easy to add even in 2.2.2; we already support URL launches for our Palm/WM registration transfer system (with the plecoregister: scheme) so while using a URL with that scheme would bring up an annoying error message, all we really need to do is add another URL protocol which does absolutely nothing aside from a normal startup and we've got a workable temporary solution.
 

mikelove

皇帝
Staff member
rcloud said:
Mike, has the ability to launch Pleco with a URL been added in the latest release?
Yes, plecolookup: - doesn't do anything with the actual text after that : yet, but it seems like it doesn't need to to work with this.
 

rcloud

举人
Thanks.

How far off in the future is more fleshed out support? It would be amazing if it you could get it to open a word included in the link... That way anki users could include the URL in their templates and only need to click on a character in their flashcards to open pleco and have it open to that character.
 

mikelove

皇帝
Staff member
rcloud said:
How far off in the future is more fleshed out support? It would be amazing if it you could get it to open a word included in the link... That way anki users could include the URL in their templates and only need to click on a character in their flashcards to open pleco and have it open to that character.
Should be in 2.3 - we've had a bunch of requests for it, actually.
 

zethcrane

Member
thanks, Mike. An off topic question, please. Can we have an option to play the audio for the word searched as we open the specific dictionary entry? Say I searched 人 then opened it, it plays how 人 should be pronounced.
 
Top