Skip to content

Commit

Permalink
#284 add unique main index columns to tables and index/replace
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewtavis committed Apr 19, 2023
1 parent 0495a72 commit f6527e7
Show file tree
Hide file tree
Showing 9 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Keyboards/KeyboardsBase/KeyboardViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ class KeyboardViewController: UIInputViewController {
expandLanguageDataset()

// Add UILexicon words including unpaired first and last names from Contacts to autocompletions.
let addToAutocompleteLexiconQuery = "INSERT INTO autocomplete_lexicon (word) VALUES (?)"
let addToAutocompleteLexiconQuery = "INSERT OR IGNORE INTO autocomplete_lexicon (word) VALUES (?)"
requestSupplementaryLexicon { (userLexicon: UILexicon!) in
for item in userLexicon.entries {
if item.documentText.count > 1 {
Expand Down
6 changes: 3 additions & 3 deletions Keyboards/KeyboardsBase/LoadData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,19 @@ func expandLanguageDataset() {
let scribeOrEmptyString = queryDBRow(query: checkScribeQuery, outputCols: outputCols, args: args)[0]

if scribeOrEmptyString == "" {
let addScribeQuery = "INSERT INTO nouns (noun, plural, form) VALUES (?, ?, ?)"
let addScribeQuery = "INSERT OR IGNORE INTO nouns (noun, plural, form) VALUES (?, ?, ?)"
writeDBRow(query: addScribeQuery, args: ["Scribe", "Scribes", ""])
writeDBRow(query: addScribeQuery, args: ["Scribes", "isPlural", "PL"])
}

// Add German compound prepositions to the prepositions table so they also receive annotations.
if controllerLanguage == "German" {
let prepositionsInsertQuery = "INSERT INTO prepositions (preposition, form) VALUES (?, ?)"
let prepositionsInsertQuery = "INSERT OR IGNORE INTO prepositions (preposition, form) VALUES (?, ?)"
for (p, f) in contractedGermanPrepositions {
writeDBRow(query: prepositionsInsertQuery, args: [p, f])
}

let autocompletionsInsertQuery = "INSERT INTO autocomplete_lexicon (word) VALUES (?)"
let autocompletionsInsertQuery = "INSERT OR IGNORE INTO autocomplete_lexicon (word) VALUES (?)"
for (p, _) in contractedGermanPrepositions {
writeDBRow(query: autocompletionsInsertQuery, args: [p])
}
Expand Down
Binary file modified Keyboards/LanguageKeyboards/French/FRLanguageData.sqlite
Binary file not shown.
Binary file modified Keyboards/LanguageKeyboards/German/DELanguageData.sqlite
Binary file not shown.
Binary file modified Keyboards/LanguageKeyboards/Italian/ITLanguageData.sqlite
Binary file not shown.
Binary file modified Keyboards/LanguageKeyboards/Portuguese/PTLanguageData.sqlite
Binary file not shown.
Binary file modified Keyboards/LanguageKeyboards/Russian/RULanguageData.sqlite
Binary file not shown.
Binary file modified Keyboards/LanguageKeyboards/Spanish/ESLanguageData.sqlite
Binary file not shown.
Binary file modified Keyboards/LanguageKeyboards/Swedish/SVLanguageData.sqlite
Binary file not shown.

0 comments on commit f6527e7

Please sign in to comment.