Results 1 to 2 of 2

Thread: Database for languages synonyms

  1. #1
    Join Date
    Apr 2021
    Location
    Italy
    Posts
    1

    Database for languages synonyms

    Hi,
    I have to store the languages ​​known by an interpreter. The problem is that many languages are also known with other names (es: Ashanti, Asante, Ashante, etc...).
    So, my idea is to have a Language Table in a Many-to-many relationship (called synonyms) with itself.
    Language : IdLanguage, Name
    Synonyms : IdL1, IdL2

    How to populate the synonyms table?
    An option is to insert for every couple (idL1, IdL2) also the specular couple (IdL2, IdL1).
    Another option is to insert only couples where IdL1<IdL2.

    With the first option it's easy to find all synonyms (idL1 = id_to_find), with the second I should query on IdL1=id_to_find or IdL2=id_to_find.
    Am I right?

    Do you have other solutions ?
    Thanks.

  2. #2
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    Interesting problem. I think you have to have an entry for each synonyms in your language table like

    LanguageID, Language, Synonyms
    1,Ashanti, "Asante, Ashante, etc..."
    2, Asante, "Ashanti, Ashante, etc..."

    If the synonyms are only different spellings of the same language which sound same, you may consider using SOUNDS LIKE function (it is SQL Server, there are equivalents in other RDBMS as well) in your query rather than storing all variations in a table.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •