pjheslin / diogenes

Diogenes: an environment for reading Latin and Greek
https://d.iogen.es/d
Other
56 stars 10 forks source link

Order results by Stephanus pagination #18

Closed carvalhar closed 5 years ago

carvalhar commented 5 years ago

Plato works are referred by Stephanus pagination, as "Apology 21 d", is it possible to sort the results, at least with this author, by this pagination?

The older and this new version of Diogenes mix the results, i think because it searches by flexion, but it would be better if we got the results in order with Stephanus:

https://en.wikipedia.org/wiki/Stephanus_pagination

Capture

pjheslin commented 5 years ago

Thanks for the suggestion. This has nothing to do with Stephanus pages, but is a fundamental result of the way searching is implemented. When you do a simple search for a pattern, the search only needs to pass through the text once, so the results come out in text order. When you do a more complex morphological or word-list searches, each pattern needs to be applied to the text in succession, so that the results come out in text order per pattern. The overall ordering is therefore disrupted.

There is no easy way to change this, and since the correct ordering is available via simple search, this is not a high priority item for me.

carvalhar commented 5 years ago

I have no idea how Diogenes is coded, but in PHP it can be solved by Multidimensional Arrays and sorting it before printing the result, maybe this is a path to develop.

https://www.w3schools.com/php/func_array_multisort.asp https://www.w3schools.com/php/php_arrays_multi.asp

pjheslin commented 5 years ago

Yes, but for large results that would be very slow and memory-intensive. And even then the result would still be sub-optimal, for duplicate or overlapping passages would not be merged.