clld / glottolog3

glottolog2 re-implemented as CLLD app
MIT License
110 stars 27 forks source link

Spaces, apostrophs and dashes in search #87

Closed agricolamz closed 6 years ago

agricolamz commented 6 years ago

It could be nice to save users a problem and allow them to do a mistake. During the search Southern East Cree on the website, everything is good. When I type Southern East Cree with two spaces before East, I see the following red box:

No matching languoids found for name part "southern east cree"

And you know what? There is only one space there!

The same story:

The same problem in Languages search tab.

UPD: GitHub markdown also doesn't like double spaces, even in code-mode.

xflr6 commented 6 years ago

Thanks, the double space from your query is acutally in the result page (i.e. glottolog3 does not mangle it):

<p>No matching languoids found for name part "southern  east cree"</p>

It is not shown by your browser because that is how HTML is defined to handle extra whitespace. We can wrap the search term in the result message in a <pre></pre> to make extra whitespace visible (good idea).

I understand you suggest to also do 'fuzzy matching' of search terms to language names by normalizing a number of similar-looking characters like different dashes (replacing them with some canonical variant which needs to be consistently used in Glottolog names, or the names would also need to be transformed before the comparison).

I am not sure how frequent the concrete mistakes you mention are. Such implicit transforrmations can make it harder for the user to reason about what the search actually does, so I am mildly against this feature (I think we try to use the ASCII-variant where possible, which should be what is available directly from the keyboard for most users). Maybe the others have another view on this.

xflr6 commented 6 years ago

Would look like this with https://github.com/clld/glottolog3/commit/380e9dca4c0d59e67660342b19b07feb6bd27267

capture

agricolamz commented 6 years ago

Cool, I get it, thanks!