Create table and indices for tatoeba sentences

This commit is contained in:
Marvin Elsen 2024-10-14 18:59:23 +02:00
parent f9a6e95a4e
commit 5983f18e75
Signed by: marvinelsen
GPG Key ID: 820672408CC318C2

View File

@ -55,6 +55,21 @@ fun main() {
"CREATE INDEX IF NOT EXISTS idx_entry_searchable_pinyin_with_tone_numbers ON entry (searchable_pinyin_with_tone_numbers)" "CREATE INDEX IF NOT EXISTS idx_entry_searchable_pinyin_with_tone_numbers ON entry (searchable_pinyin_with_tone_numbers)"
) )
statement.executeUpdate(
"""
CREATE TABLE IF NOT EXISTS sentence(
id INTEGER PRIMARY KEY,
traditional TEXT NOT NULL,
simplified TEXT NOT NULL,
character_count INTEGER NOT NULL,
CONSTRAINT character_count_gte CHECK(character_count > 0)
);
""".trimIndent()
)
statement.executeUpdate("CREATE INDEX IF NOT EXISTS idx_sentence_traditional ON sentence (traditional)")
statement.executeUpdate("CREATE INDEX IF NOT EXISTS idx_sentence_simplified ON sentence (simplified)")
statement.executeUpdate("CREATE INDEX IF NOT EXISTS idx_sentence_character_count ON sentence (character_count)")
val cedictParser = CedictParser.instance val cedictParser = CedictParser.instance
val cedictEntries = val cedictEntries =
cedictParser.parseCedict( cedictParser.parseCedict(