Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 836597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:00:34+00:00 2026-05-15T05:00:34+00:00

I am working on an app which is to suggest alternative words/phrases for input

  • 0

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:

  1. number of synonyms is variable, i.e. football has one synonym (soccer), but in particular has two (particularly, specifically)
  2. if football is a synonym to soccer, the relation exists in the opposite direction as well.
  3. our goal is to query a word and find its synonyms
  4. 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 = word and
  • col b = delimited list of synonyms

Is there any better alternative? What about using two tables, one for words and the other for relations?

Edit:
After reading the answers, another approach came to my mind. It’s using a single column table with all synonym words, each wrapped in word boundary marker. With that i mean something like
|in particular|particularly|specifically|
Then I’d query the table with
SELECT * FROM synonyms WHERE word LIKE '%|specifically|%'
And in code I trash the preceding and trailing |s and do a split and have the synonyms.

Anything bad in that, that I’m not seeing?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:00:35+00:00Added an answer on May 15, 2026 at 5:00 am

    After reading the answers, another approach came to my mind. It’s using a single column table with all synonym words, each wrapped in word boundary marker. With that i mean something like

    |in particular|particularly|specifically|

    Then I’d query the table with

    SELECT * FROM `synonyms` WHERE `word` LIKE '%|$word|%'
    

    And in code I trash the preceding and trailing |s and do an explode and have the synonyms:

    $synonyms = $row['word'];
    $synonyms = explode('|', substr($synonyms, 1, -1));
    unset($synonyms[$word]);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have made an android app which working fine. I implemented the Login functionality
I'm working on an app in which i have to detect left eye, right
I'm working on the design of a web app which will be using AJAX
I am am working on my app.which have requirement play video on iPhone by
I have been working on an app which requires finding the height and width
I'm working on an Android app in which I have to open & close
I am working on App which will set an alarm on ios for a
i am working on app which deals with proximity alerts. I can add proximity
I am working on an app which calls a rest web service. Sometimes the
I am working on an app which uses Commonslang.jar libraries. I was trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.