GNOME Bugzilla – Bug 471362
Should have more useful sources (Wikipedia?)
Last modified: 2021-06-10 11:23:20 UTC
Having a Wikipedia source, and being able to switch languages means that we'd get very good support for 14 languages. The default source could be chosen depending on the locale. MacOS X' dictionary can use Wikipedia http://www.thinksecret.com/archives/leopard9a527/image/dictionary001.jpg
does wikipedia provide a web API to retrieve the data in text/plain form? is any documentation available? otherwise I'd have to embed a web browser into the dictionary, and that I would like to avoid; or I'd have to screenscrape the contents of a wiki page through something like lynx to have it in text/plain, and that too I'd like to avoid.
It looks like the DBPedia page offers a decent API. It doesn't contain all the data that the actual Wikipedia page does, but it might be a good thing, allowing the user to click an item to get more information in a browser. Here's an example page: http://dbpedia.org/page/Manchester_United_F.C. http://dbpedia.org/docs/ There's also the FUTEF API: http://api.futef.com/apidocs.html The MediaWiki API, available directly from Wikipedia: http://en.wikipedia.org/w/api.php A "special export" type of page from Wikipedia: http://en.wikipedia.org/wiki/Special:Export/Train A Perl search API: http://search.cpan.org/~esummers/WWW-Wikipedia/lib/WWW/Wikipedia.pm
the Special:Export page looks promising. I think libsoup could be used to retrieve the data from the web and then the returned XML could be parsed to generate the output. thanks for the pointers!
*** Bug 492626 has been marked as a duplicate of this bug. ***
nothing new about that feature request ?
Don't forget to use wiktionary.org, which makes more sense at first than wikipedia.org.
*** Bug 597249 has been marked as a duplicate of this bug. ***
I think we need to define a new GdictSource interface, for which the current GdictSource would be an implementation; another implementation would handle a wiktionary source. I think wiktionary and DICT sources share almost nothing, maybe just a name and a description; so we need to add a ::protocol property to identify the implementation. I don't know if this is a good pattern. Anyway, undoubtedly we need a wiktionary source and an associated context, so I will start with that. The output can now be retrieved also in json format.
I've started this as a proof of concept https://github.com/juanrgar/gnome-wiktionary
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org. As part of that, we are mass-closing older open tickets in bugzilla.gnome.org which have not seen updates for a longer time (resources are unfortunately quite limited so not every ticket can get handled). If you can still reproduce the situation described in this ticket in a recent and supported software version of gnome-dictionary, then please follow https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines and create a ticket at https://gitlab.gnome.org/GNOME/gnome-dictionary/-/issues/ Thank you for your understanding and your help.