itkach / aard2-android

Aard2 for Android, a simple dictionary app
GNU General Public License v3.0
457 stars 97 forks source link

Searching chapter in Wikibooks requires full path #146

Closed bagnacauda closed 2 years ago

bagnacauda commented 2 years ago

Hi, I'm trying to use Aard2 to access the Italian Wikibooks, which contains a cookbook under the name 'Libro di cucina', and each chapter has a name with a different recipe. Searching for the chapter doesn't work unless the full path is provided. Is this the intended behavior? If so what can I do to avoid entering the full path?

itkach commented 2 years ago

Is this the intended behavior?

Kind of, yes: not really intended, it just follows from how wikibooks are structured and the fact there is no special treatment for them. My understanding is that wikibooks is a collection of pages that have title like <Book Title> (lists chapters) and <Book Title>/<Chapter Titles> (or with more levels of nesting like <Book Title>/<Section Title>/<Chapter Title>) , and these page titles is what gets into lookup index. Technically it is possible to implement wikibooks-specific logic to also add chapter titles alone (with book/section title prefix stripped) into lookup index at dictionary compile time, but chapter titles are typically not descriptive/unique enough to be useful, e.g. you may very well end up with dozens of "Chapter 1". My impression is that Wikibooks' own search also doesn't do a very good job finding stuff by chapter title alone.

what can I do to avoid entering the full path?

You can fork https://github.com/itkach/mw2slob and implement adding any lookup keys you want specifically for wikibooks or even more specifically for Italian Wikibooks, or even one specific book you care about.

Personally, wikibooks never made any sense to me. Maybe it is an acceptable platform to collaborate on writing books, but it doesn't appear to be fit for the purpose of consuming that content.