Alternative design for a synonyms table?
Posted
by Majid
on Stack Overflow
See other posts from Stack Overflow
or by Majid
Published on 2010-05-27T02:12:25Z
Indexed on
2010/05/27
2:21 UTC
Read the original article
Hit count: 367
database-design
I am working on an app which is to suggest alternative words/phrases for input text. I have doubts about what might be a good design for the synonyms table.
Design considerations:
- number of synonyms is variable, i.e.
footballhas one synonym (soccer), butin particularhas two (particularly,specifically) - if
footballis a synonym tosoccer, the relation exists in the opposite direction as well. - our goal is to query a word and find its synonyms
- we want to keep the table small and make adding new words easy
What comes to my mind is a two column design with
col a = wordandcol b = delimited list of synonyms
Is there any better alternative? What about using two tables, one for words and the other for relations?
© Stack Overflow or respective owner