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 8025751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:16:04+00:00 2026-06-04T23:16:04+00:00

I am trying to re-write a dictionary program in python(3.X). I have been using

  • 0

I am trying to re-write a dictionary program in python(3.X). I have been using JSON but thought it could be fun to try my hand at SQLlite. My question is:

I have:

  1. a word
  2. a list of sentences using the word
  3. a list of synonyms
  4. a list of antonyms

what is the the cleanest way to organise the data using SQLite3?

what I thought was to one table with unique id’s for the ‘val and example’ and then create new entries for synonyms and antonyms if they do not yet exist.

ValId  Val        Eaxmples
1      'hot'      'the water is hot\n she's hot\n'
2      'warm'     '...'
3      'cold'     '...'
4      'freezing' '...'

but then how would I create a table that could point back to multiple id’s?
for example 'hot' points to 2 as a synonym and 3 , 4 as antonyms. How would I create multiple ponters, do I have to put them in a sting and then parse them, as I do not know how may synonyms or antonyms might be created.

LinksID  ValID SynIDs AntsIds
   1        1     2      3,4
  • 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-06-04T23:16:06+00:00Added an answer on June 4, 2026 at 11:16 pm

    I would create two separate tables, one for synonyms and one for antonyms where you have FOREIGN KEYS to reference your words:

    CREATE TABLE synonym (
        SynID INTEGER,
        WordID1 INTEGER,
        WordID2 INTEGER,
        FOREIGN KEY (WordID1) REFERENCES word(ValID),
        FOREIGN KEY (WordID2) REFERENCES word(ValID)
    );
    
    CREATE TABLE antonym (
        AntID INTEGER,
        WordID1 INTEGER,
        WordID2 INTEGER,
        FOREIGN KEY (WordID1) REFERENCES word(ValID),
        FOREIGN KEY (WordID2) REFERENCES word(ValID) 
    );
    

    Then you don’t have to worry about having an unknown number of synonyms and antonyms for each word. You would then get the following structure:

    Your word table:

    ValId  Val        Eaxmples
    1      'hot'      'the water is hot\n she's hot\n'
    2      'warm'     '...'
    3      'cold'     '...'
    4      'freezing' '...'
    

    Your synonym table:

    SynID  WordID1  WordID2
    1      1        2
    2      3        4
    

    And your antonym table:

    AntID  WordID1  WordID2
    1      1        3
    2      1        4
    3      2        3
    4      2        4
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hello I am trying to write these python lines in a single line but
I am trying to write a wrapper object around the dictionary object in python
I'm trying to write an extension method to insert data into a dictionary of
I'm trying to write a spellchecker module. It loads a text, creates a dictionary
I am trying write a function that generates simulated data but if the simulated
Trying to write out syslog entries containing strings but they don't register. // person.name
I'm trying to write a predicate to check a specific value in a dictionary
I trying to write an application that has a collection of students using different
I am trying to write a javascript function that calls an Dictionary value and
I have made a simple, test program to experiment using classes. It creates a

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.