1. Thesaurus database
- Posted by GreenEuphorian Nov 27, 2014
- 1138 views
I am thinking of managing a thesaurus database using Euphoria. It would have a list of synonyms and a list of antonyms for every entry.
What's the best way to structure the database?
Thanks
2. Re: Thesaurus database
- Posted by petelomax Nov 28, 2014
- 1090 views
I am thinking of managing a thesaurus database using Euphoria. It would have a list of synonyms and a list of antonyms for every entry.
What's the best way to structure the database?
Thanks
Off the top of my head, for simplicity:
words: key is string, data is {{synonyms},{antonyms}} (yet more strings)
Or for size:
words: key is string, data is unique_id (probably db_table_size()+1)
index: key is unique_id, data is {word(string),{synonym_ids},{antonym_ids}}
Pete
3. Re: Thesaurus database
- Posted by DerekParnell (admin) Nov 29, 2014
- 1055 views
I am thinking of managing a thesaurus database using Euphoria. It would have a list of synonyms and a list of antonyms for every entry.
What's the best way to structure the database?
Thanks
One way would be to use the EDS database library that comes with OpenEuphoria. You can do it using two tables.
-- Sets of Words - A set of closely related synonyms, with zero or one antonym. To find other antonyms, look up the synonyms for the supplied one. -- id_set { SetId, {Synonym,...} , Antonym, Usage } { 1, {"gird", "girdle", "engird", "encircle", "surround", "enclose", "encompass", "begird", "environ", "hem", "border"}, "open", VERB} { 2, {"girdle"}, 0, NOUN} { 3, {"surround", "enclosure"}, 0, NOUN} { 4, {"hem", "edge", "border"}, 0, NOUN} { 5, {"open", ...}, {}, "close", VERB} { 6, {"close", ...}, {}, "open", VERB} { 7, {"gird", "invest", "equip", "furnish", "clothe"}, "strip", VERB} { 8, {"strip", ...}, "apply", VERB} -- Words in Sets -- word_set_id { word, { SetId, ...}} { "gird", {1,7}} { "girdle", {1,2}} { "engird", {1}} { "encircle", {1}} { "surround", {1,3}} { "enclose", {1}} { "encompass", {1}} { "begird", {1}} { "environ", {1}} { "hem", {1,4}} { "open", {5}} { "close", {6}} { "invest", {7}} { "equip", {7}} { "furnish", {7}} { "clothe", {7}} { "strip", {8}}
4. Re: Thesaurus database
- Posted by GreenEuphorian Nov 29, 2014
- 1094 views
Thanks to both of you, Pete and Derek. I'll be mulling over your suggestions and choose the easiest way for me.