dronefly-garden / dronefly

Red Discord Bot V3 cogs for naturalists.
Other
16 stars 3 forks source link

taxon: provide better hinting for "best match" for common name #159

Open synrg opened 3 years ago

synrg commented 3 years ago

Problem: the user meant to match a particular common name and the bot selected a different one

Two examples brought up on Discord:

,t kagu matches an Estonian common name for a bird with more observations than the desired match:

image

The correct result can be brought up with the ,t lang subcommand, but almost nobody knows about this:

image

In fact, there's a second problem here, which is that "kagu" is not the preferred common name for the genus. "kagus" is. This, too, can be provided for using an rank sp filter, but again, most users don't remember that this can be done.

image

,t redshank matches a non-preferred common name:

image

If the bird was meant, the user needs to know that in birds must be specified to filter:

image

Subproblems:

There is a whole grab-bag full of different issues here:

Possible approaches:

Each one of these possible solutions should have its own issue. None of them are mutually exclusive, and each covers a different aspect of the overall problem.

synrg commented 2 years ago

Note that #164 partially implements ,user set lang en, but it does not prevent non-English common names from matching.

Of all of the possible approaches I listed above, I like keeping the matched name as close as possible to how it works on the web, but also provide an easy way to select an alternative if the top match isn't what was desired. That, in effect, is what the autocomplete on the website accomplishes: the top match is usually, but not always, what the user wanted. Therefore, the rest of the matches are shown in case they wanted a different match.

synrg commented 2 years ago

Here's another case, but it's not quite the same as the cases above. If you search for rhododendrons, the matched_term is rhododendronsläktet which very likely is not what you'd like to see:

image

See https://api.inaturalist.org/v1/taxa/autocomplete?q=rhododendrons

If you look at how it works on the web, it's not showing matched term here, but instead shows the preferred common name:

image