Oxford Languages(formerly Oxford Dictionaries) provide OD API and users can use it for free (with limit) and for transaction based tariff.
https://languages.oup.com/products/api/
It is great if OmegaT supports OD API for all the languages OD provides.
Now OmegaT's DictionaryFactory API don't provide an interface for online dictionary.
There are two options;
I proposed option 2
https://github.com/omegat-org/omegat/pull/160
I implement oxford dictionaries plugin using proposed API.
https://github.com/miurahr/omegat-oxford-dictionaries
There is another issue than registration API.
When implementing the plugin, I found
readArticlePredicated(word)
method called for each word. This preventing HTTP API communication performance. Because API is synchronously called, API client cannot call web API asynchronous or pipeline way, It forced to loopopen socket
+connection
+send get method
+close connection
then parse it.omegat-oxford-dictionaries prototype plugin performs very slow. Because of the reason explained above and web server query/response delay, it takes about 30 second to show 12 dictionary entries.
I'd like to request an new interface to pass a list or set of words to query, and accept articles asynchronously to solve the issue. For example
IDicitonary interface:
DictinoaryManager class:
Dictionary drivers can handle the request in their own way.
Disk based driver may query indexes and sort order by index, then read articles.
Network based driver may send bulk request to the server and parse result in threading.
Last edit: Hiroshi Miura 2021-10-24
Merged to master as 1098b4f05e