caarmen / poet-assistant

Android app with rhyming dictionary, thesaurus, and dictionary, with text-to-speech functionality to read your poem.
Other
83 stars 11 forks source link

Merge the databases #33

Closed caarmen closed 7 years ago

caarmen commented 7 years ago

Currently the app has 3 database files, for:

Perhaps the app size can be reduced by merging the three into a single database file with tables:

Crossed out suggestions (regarding joins) make the db queries slower. This was the attempt to reduce redundancy and make the word_variants table reference a "word" table instead of duplicating the words:

CREATE TABLE word (wordid INTEGER PRIMARY KEY, word VARCHAR (80) NOT NULL, stem VARCHAR (80), google_ngram_frequency INTEGER);
CREATE TABLE word_variants (wordid integer, variant_number integer, stress_syllables text, last_syllable text, last_two_syllables text, last_three_syllables text, has_definition integer, foreign key (wordid) references word(wordid));
CREATE INDEX word_variants_fk on word_variants (wordid);
CREATE UNIQUE INDEX word_word_id_pk on word(wordid);