qpixel icon indicating copy to clipboard operation
qpixel copied to clipboard

Tag synonyms

Open cellio opened this issue 5 years ago • 6 comments

https://judaism.codidact.com/questions/276821

Sometimes there's more than one way to describe a concept and the words are very different -- even more so when a community uses more than one language, like Judaism where there are both Hebrew and English terms for things. It would be helpful to be able to create tag synonyms so all those posts get tagged the same way regardless of how the author thinks of the concept.

cellio avatar Nov 10 '20 03:11 cellio

Related: https://meta.codidact.com/questions/276918

How would this be implemented? One main tag searchable by synonyms, or multiple synonymous tags?

  • The first way is that when someone puts "tefillah" in the tags box, then the option "prayer (synonyms: tefillah)" would appear in the dropdown, but clicking on it just gives "prayer". This way, there is just one tag that is searchable by name synonyms. This might give problems when filtering searches by tags is implemented though.
  • Another way is that when typing "tefillah", the tag "tefillah" would appear as the suggestion. Same for "prayer". However, when searching "tefillah", things tagged "prayer" are included, and vice versa. This way, "tefillah" and "prayer" are separate tags, but they have a relationship to each other (not unlike how we can set parent-child relationships now).

MoshiKoi avatar Nov 12 '20 01:11 MoshiKoi

I was thinking of one tag, not two different tags that happen to include each other in search results, for clarity. A tag that is a synonym would show up in the list as, e.g., "tefillah (prayer)" and then "prayer" would be the tag on the post when you submit it. The tag description for "prayer" would list "tefillah" as a synonym, maybe right after or as part of the short description (should be visible in the tags list too).

I'm open to other approaches. I'd be concerned by having what look like two different tags (in the tags field on a post, the tags list, and wherever else tags might show up), even if they both lead you to the same list of posts, because before you get to that list you'll see two different things. Maybe that'd be ok if synonyms have some special styling, but it's still a thing for people to learn.

cellio avatar Nov 12 '20 01:11 cellio

@cellio The main advantage of the multiple tag approach is that it is easy to implement - we'd just need to add another relationship between tags. The "many to one" name mapping is preferable to me, but I'm not sure Select2 supports it (we'd have to write our own plugin).

MoshiKoi avatar Nov 12 '20 20:11 MoshiKoi

Your first approach is workable, @MoshiKoi, just needs to be done server-side rather than in Select2.

ArtOfCode- avatar Nov 13 '20 01:11 ArtOfCode-

@ArtOfCode- you said option 1 is workable. How would it affect search? (Moshi brought up that issue in an earlier comment.)

cellio avatar Nov 07 '21 19:11 cellio

Seems doable to implement, I can give this one a try.

Taeir avatar Sep 12 '22 21:09 Taeir