qpixel icon indicating copy to clipboard operation
qpixel copied to clipboard

Add friction for probably-duplicate tags like singular/plural

Open cellio opened this issue 2 years ago • 1 comments

meta:288738

Currently, anyone who can post can create new tags by typing them into the tags part of the editor. We have good auto-suggestions but still, sometimes people manage to create, say, the singular form of an existing plural tag (like "tag" vs "tags"). Can we put some extra checks around that? I'm imagining an interface where the system says "did you mean (other tag)?" and the options are "yes" (use that) or "no, I really do mean this new very similar tag" (create it).

At minimum, it should trigger if the new tag is an initial substring of another tag. I don't know how practical it is to also catch "almost substrings" like with "y"/"-ies" singular/plural variants; that might not be worth the additional complexity.

cellio avatar Nov 23 '23 01:11 cellio

@cellio if we are feeling fancy, we can calculate edit distance and suggest a limited set of tags with low distance. At least with the Levenstein distance (a library can handle most of the workload, plus it's relatively easy to implement manually too) algorithm. A trie implementation would be better, but also significantly more complex (if anyone knows of a good library to avoid manually implementing one, let me know).

A naive implementation of just checking if the tag name is an initial substring of another tag would only be annoying to users, methinks (or, best case scenario, a constant source of amusing suggestions).

Oaphi avatar Nov 25 '23 11:11 Oaphi