johnfactotum / quick-lookup

Simple GTK dictionary application powered by Wiktionary
GNU General Public License v3.0
94 stars 8 forks source link

[Feature request] display noun genders #19

Open urandom opened 3 years ago

urandom commented 3 years ago

Not sure how possible this is, considering the source. but noun genders are very important in certain languages (e.g. German).

Would it be possible to somehow extract and display them?

Example: https://en.wiktionary.org/wiki/Bedienung#German

It seems that the only indication of the gender of this noun is the the category link [German feminine nouns]. Perhaps looking for masculine, feminine or neuter category links would be sufficient

urandom commented 3 years ago

It looks like the 'Declension' table for nouns is a better fit for getting the gender. It would be sufficient to display the singular definite article for nominative.

johnfactotum commented 3 years ago

Unfortunately this is not supported by Wiktionary's definition API. The only alternative would be manually parsing the HTML or even wikitext, which I'd rather not do, or at least that's something that I've been glad that I wouldn't have to do ever since I discovered the API.

But I suppose, since the API is extremely lacking, maybe it'd be worth it to write our own thing instead.

Another option would be to wait for the Wiktionary project to either improve their own parser or to finally migrate to structured data. Might have to wait a long time for either to happen, though...