4

想法是在用户和内容(图像、视频、帖子)之间建立一个标记系统,有点像 SO 上的标记系统,带有问题。

我喜欢 SO 上的成就系统,这意味着在获得一定数量的积分后,用户可以开始制作他/她自己的标签。我的系统也有同样的想法

我目前的桌子设计看起来像

Tag           UserTag       User
---           -------       ----
tag_id        user_id       user_id
tag_name      tag_id        username
usage_count                 .... 

它让我想到了这个问题。

Q如何为不同语言的内容建立一个标记系统。

  • 但同时能够使用不同语言的标签搜索相同的内容。
  • 对同一标签使用不同语言自动完成

当我使用自动完成时,我会搜索标签名称,例如用户输入的字符。

例如,我有一个名为“nightclub”的英文标签

但是如果他们标记翻译是“discothèque”,那么在法语中


或者有没有办法做到这一点,只是让人们用不同的语言制作标签。

4

2 回答 2

2

是的你可以。但请注意,一种语言中的某些单词可能在其他语言中有多种翻译。

您可能有一个languages表,一个tags只有 的表,以及一个带有, ,tag_id的多对多表。language_idtag_idtag_name

Like I said previously, you might run into problems when people want to make refinements that their own language allows, but other languages can't. To stay in the french example, talking about bread, you may have 'baguette', 'flûte', 'recuit', 'demi-recuit', etc. tags, whereas the english would merely have a 'bread' tag. The mapping between the tags in then significantly complicated. but that's a general translation problem, not only in programming realm.


Regarding your comment : a compromise would be to add a "tag_related_to_tag" table, allowing to make couplings between tags. Users could tell which tag is related to which other in a different language. This would allow the maximum flexibility with the minimum of complexity, but would need some administration (otherwise you might have evil users making very unexpected relationships between tags, breaking the usefulness of the system).

That's something I actually was thinking to implement for a website which has a very narrow field (stoic philosophy) and target public. If the field is too broad, it might be very ineffective.

于 2010-01-05T15:32:38.970 回答
1

Interesting question! Just some thoughts (not intended a a complete solution, it's more a set of questions):

A straightforward approach is having an internal tag ID and for each language a localized name.

If no localized name was created yet, you may need to fall back to the tag name in a 'primary' language - usually english - or the language the tag was created in.

Translation needs to be done by a user ho knows both languages, automatic translations are IMO to imprecise. So probably a user right (bound to rewards?) to rename tags.

Are all languages equal, or are tags only created in a "primary language" understood by most users, and translations added separately? (The latter looks less fair, but would probably make some things easier)

You need an ability to merge tags - e.g. when users independently created "discothèque" and "nightclub".

Do I see only the tags that are available in my language, or can I see tags available in other languages that don't have translations to my language? Can I search for tags in other languages?

Is the tag name included in a query string? Will my german query link work when I send it to a friend in the US?

How to resolve disputes regarding the tag meaning? Example: The closest translation to german is "Nachtclub" for night club, and "Diskothek" for "discothèque". But in german, a "Nachtclub" is quite different from a "Diskothek" (though there is some overlap).

于 2010-01-05T15:58:10.030 回答