Skip to content

Commit f6527e7

Browse files
committed
#284 add unique main index columns to tables and index/replace
1 parent 0495a72 commit f6527e7

File tree

9 files changed

+4
-4
lines changed

9 files changed

+4
-4
lines changed

Keyboards/KeyboardsBase/KeyboardViewController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1470,7 +1470,7 @@ class KeyboardViewController: UIInputViewController {
14701470
expandLanguageDataset()
14711471

14721472
// Add UILexicon words including unpaired first and last names from Contacts to autocompletions.
1473-
let addToAutocompleteLexiconQuery = "INSERT INTO autocomplete_lexicon (word) VALUES (?)"
1473+
let addToAutocompleteLexiconQuery = "INSERT OR IGNORE INTO autocomplete_lexicon (word) VALUES (?)"
14741474
requestSupplementaryLexicon { (userLexicon: UILexicon!) in
14751475
for item in userLexicon.entries {
14761476
if item.documentText.count > 1 {

Keyboards/KeyboardsBase/LoadData.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,19 @@ func expandLanguageDataset() {
9696
let scribeOrEmptyString = queryDBRow(query: checkScribeQuery, outputCols: outputCols, args: args)[0]
9797

9898
if scribeOrEmptyString == "" {
99-
let addScribeQuery = "INSERT INTO nouns (noun, plural, form) VALUES (?, ?, ?)"
99+
let addScribeQuery = "INSERT OR IGNORE INTO nouns (noun, plural, form) VALUES (?, ?, ?)"
100100
writeDBRow(query: addScribeQuery, args: ["Scribe", "Scribes", ""])
101101
writeDBRow(query: addScribeQuery, args: ["Scribes", "isPlural", "PL"])
102102
}
103103

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

111-
let autocompletionsInsertQuery = "INSERT INTO autocomplete_lexicon (word) VALUES (?)"
111+
let autocompletionsInsertQuery = "INSERT OR IGNORE INTO autocomplete_lexicon (word) VALUES (?)"
112112
for (p, _) in contractedGermanPrepositions {
113113
writeDBRow(query: autocompletionsInsertQuery, args: [p])
114114
}
3.68 MB
Binary file not shown.
8.52 MB
Binary file not shown.
2.76 MB
Binary file not shown.
2.62 MB
Binary file not shown.
19 MB
Binary file not shown.
4.55 MB
Binary file not shown.
5.38 MB
Binary file not shown.

0 commit comments

Comments
 (0)