Start modelling a sqlite database

This commit is contained in:
Oystein Kristoffer Tveit 2022-05-07 18:35:50 +02:00
parent 936c669118
commit 46fb93efe3
24 changed files with 148559 additions and 0 deletions

View File

@ -0,0 +1,282 @@
-- KANJI
CREATE TABLE Kanji_YomiExample (
exampleID INTEGER PRIMARY KEY AUTOINCREMENT,
example TEXT NOT NULL,
reading TEXT NOT NULL,
meaning TEXT NOT NULL,
UNIQUE (example, reading, meaning)
);
CREATE TABLE Kanji_Radical (
id INTEGER NOT NULL UNIQUE,
symbol CHAR(1) NOT NULL PRIMARY KEY,
strokes INTEGER NOT NULL,
meaning TEXT NOT NULL,
searchSymbol CHAR(1)
);
CREATE TABLE Kanji_Radical_Forms (
form TEXT NOT NULL PRIMARY KEY,
radical CHAR(1) NOT NULL,
FOREIGN KEY(radical) REFERENCES Kanji_Radical(symbol)
);
CREATE TABLE Kanji_Kunyomi (
yomi TEXT NOT NULL PRIMARY KEY
);
CREATE TABLE Kanji_Onyomi (
yomi TEXT NOT NULL PRIMARY KEY
);
CREATE TABLE Kanji_Part (
part TEXT NOT NULL PRIMARY KEY
);
CREATE TABLE Kanji_Result (
kanji CHAR(1) PRIMARY KEY,
taughtIn INTEGER,
jlptLevel INTEGER,
newspaperFrequencyRank INTEGER,
strokeCount INTEGER NOT NULL,
meaning INTEGER NOT NULL,
radical CHAR(1) NOT NULL,
FOREIGN KEY (radical) REFERENCES Kanji_Radical(symbol)
);
CREATE TABLE Kanji_ResultKunyomiExample_XRef (
exampleID INTEGER NOT NULL,
kanji TEXT NOT NULL,
FOREIGN KEY(exampleID) REFERENCES Kanji_YomiExample(exampleID),
FOREIGN KEY(kanji) REFERENCES Kanji_Result(kanji),
PRIMARY KEY(exampleID, kanji)
);
CREATE TABLE Kanji_ResultOnyomiExample_XRef (
exampleID INTEGER NOT NULL,
kanji TEXT NOT NULL,
FOREIGN KEY(exampleID) REFERENCES Kanji_YomiExample(exampleID),
FOREIGN KEY(kanji) REFERENCES Kanji_Result(kanji),
PRIMARY KEY(exampleID, kanji)
);
CREATE TABLE Kanji_ResultKunyomi_XRef (
yomi TEXT NOT NULL,
kanji TEXT NOT NULL,
FOREIGN KEY(yomi) REFERENCES Kanji_Kunyomi(yomi),
FOREIGN KEY(kanji) REFERENCES Kanji_Result(kanji),
PRIMARY KEY(yomi, kanji)
);
CREATE TABLE Kanji_ResultOnyomi_XRef (
yomi TEXT NOT NULL,
kanji TEXT NOT NULL,
FOREIGN KEY(yomi) REFERENCES Kanji_Onyomi(yomi),
FOREIGN KEY(kanji) REFERENCES Kanji_Result(kanji),
PRIMARY KEY(yomi, kanji)
);
CREATE TABLE Kanji_ResultPart_XRef (
part TEXT NOT NULL,
kanji TEXT NOT NULL,
FOREIGN KEY(part) REFERENCES Kanji_Part(part),
FOREIGN KEY(kanji) REFERENCES Kanji_Result(kanji),
PRIMARY KEY(part, kanji)
);
-- Example Sentence
CREATE TABLE ExampleSentence_Result (
resultID INTEGER PRIMARY KEY AUTOINCREMENT,
kanji TEXT NOT NULL,
kana TEXT NOT NULL,
english TEXT NOT NULL
);
CREATE TABLE ExampleSentence_Piece (
orderNum INTEGER NOT NULL,
lifted TEXT,
unlifted TEXT NOT NULL,
resultID INTEGER NOT NULL,
FOREIGN KEY(resultID) REFERENCES ExampleSentence_Result(resultID),
PRIMARY KEY(resultID, orderNum)
);
-- Words
CREATE TABLE PhraseScrape_Result (
uri TEXT NOT NULL PRIMARY KEY
);
CREATE TABLE PhraseScrape_Sentence (
english TEXT NOT NULL,
japanese TEXT NOT NULL,
PRIMARY KEY (english, japanese)
);
CREATE TABLE PhraseScrape_Sentence_Piece (
orderNum INTEGER NOT NULL,
lifted TEXT,
unlifted TEXT NOT NULL,
sentenceEnglish TEXT NOT NULL,
sentenceJapanese TEXT NOT NULL,
FOREIGN KEY(sentenceEnglish, sentenceJapanese) REFERENCES PhraseScrape_Sentence(english, japanese) ON DELETE CASCADE,
PRIMARY KEY (sentenceEnglish, sentenceJapanese, orderNum)
);
CREATE TABLE PhraseScrape_Meaning_SeeAlsoTerm (
seeAlsoTerm TEXT NOT NULL,
meaningDefinition TEXT NOT NULL,
resultUri TEXT NOT NULL,
FOREIGN KEY (meaningDefinition, resultUri) REFERENCES PhraseScrape_Meaning (definition, resultUri) ON DELETE CASCADE,
PRIMARY KEY (seeAlsoTerm, meaningDefinition, resultUri)
);
CREATE TABLE PhraseScrape_Meaning_Supplemental (
supplemental TEXT NOT NULL,
meaningDefinition TEXT NOT NULL,
resultUri TEXT NOT NULL,
FOREIGN KEY (meaningDefinition, resultUri) REFERENCES PhraseScrape_Meaning (definition, resultUri) ON DELETE CASCADE,
PRIMARY KEY (supplemental, meaningDefinition, resultUri)
);
CREATE TABLE PhraseScrape_Meaning_Tag (
tag TEXT NOT NULL,
meaningDefinition TEXT NOT NULL,
resultUri TEXT NOT NULL,
FOREIGN KEY (meaningDefinition, resultUri) REFERENCES PhraseScrape_Meaning (definition, resultUri) ON DELETE CASCADE,
PRIMARY KEY (tag, meaningDefinition, resultUri)
);
CREATE TABLE PhraseScrape_Meaning (
definition TEXT NOT NULL,
definitionAbstract TEXT,
resultUri TEXT NOT NULL,
FOREIGN KEY(resultUri) REFERENCES PhraseScrape_Result(uri) ON DELETE CASCADE,
PRIMARY KEY(definition,resultUri)
);
CREATE TABLE PhraseScrape_MeaningSentence_XRef (
sentenceEnglish TEXT NOT NULL,
sentenceJapanese TEXT NOT NULL,
resultUri TEXT NOT NULL,
FOREIGN KEY(resultUri) REFERENCES PhraseScrape_Result(uri) ON DELETE CASCADE,
FOREIGN KEY(sentenceEnglish, sentenceJapanese) REFERENCES PhraseScrape_Sentence(english, japanese) ON DELETE CASCADE
);
CREATE TABLE PhraseScrape_KanjiKanaPair (
kanji TEXT NOT NULL,
kana TEXT,
resultUri TEXT NOT NULL,
FOREIGN KEY(resultUri) REFERENCES PhraseScrape_Result(uri) ON DELETE CASCADE,
PRIMARY KEY (kanji, kana, resultUri)
);
CREATE TABLE PhraseScrape_AudioFile (
uri TEXT NOT NULL PRIMARY KEY,
mimetype TEXT NOT NULL,
resultUri TEXT NOT NULL,
FOREIGN KEY(resultUri) REFERENCES PhraseScrape_Result(uri) ON DELETE CASCADE
);
CREATE TABLE PhraseScrape_Note (
note TEXT NOT NULL,
resultUri TEXT NOT NULL,
FOREIGN KEY(resultUri) REFERENCES PhraseScrape_Result(uri) ON DELETE CASCADE,
PRIMARY KEY (note, resultUri)
);
-- API
CREATE TABLE PhraseSearch_JishoResult (
slug TEXT NOT NULL PRIMARY KEY,
isCommon BOOLEAN
);
CREATE TABLE PhraseScrape_JishoResult_Tag (
tag TEXT NOT NULL,
resultSlug TEXT NOT NULl,
FOREIGN KEY(resultSlug) REFERENCES PhraseSearch_JishoResult(slug) ON DELETE CASCADE,
PRIMARY KEY (tag, resultSlug)
);
CREATE TABLE PhraseScrape_JishoResult_Jlpt (
jlpt TEXT NOT NULL,
resultSlug TEXT NOT NULl,
FOREIGN KEY(resultSlug) REFERENCES PhraseSearch_JishoResult(slug) ON DELETE CASCADE,
PRIMARY KEY (jlpt, resultSlug)
);
CREATE TABLE PhraseSearch_JapaneseWord (
word TEXT,
reading TEXT,
resultSlug TEXT NOT NULl,
FOREIGN KEY(resultSlug) REFERENCES PhraseSearch_JishoResult(slug) ON DELETE CASCADE,
PRIMARY KEY (word, reading, resultSlug),
CHECK (word NOT NULL OR reading NOT NULL)
);
CREATE TABLE PhraseSearch_WordSense (
id INTEGER PRIMARY KEY AUTOINCREMENT
);
CREATE TABLE PhraseSearch_WordSense_Link (
text TEXT NOT NULL,
url TEXT NOT NULL,
senseID INTEGER NOT NULL,
FOREIGN KEY(senseID) REFERENCES PhraseSearch_WordSense(id) ON DELETE CASCADE,
PRIMARY KEY(url, senseID)
);
CREATE TABLE PhraseSearch_WordSense_Tag (
tag TEXT NOT NULL,
senseID INTEGER NOT NULL,
FOREIGN KEY(senseID) REFERENCES PhraseSearch_WordSense(id) ON DELETE CASCADE,
PRIMARY KEY (tag, senseID)
);
CREATE TABLE PhraseSearch_WordSense_SeeAlso (
seeAlso TEXT NOT NULL,
senseID INTEGER NOT NULL,
FOREIGN KEY(senseID) REFERENCES PhraseSearch_WordSense(id) ON DELETE CASCADE,
PRIMARY KEY (seeAlso, senseID)
);
CREATE TABLE PhraseSearch_WordSense_Antonym (
antonym TEXT NOT NULL,
senseID INTEGER NOT NULL,
FOREIGN KEY(senseID) REFERENCES PhraseSearch_WordSense(id) ON DELETE CASCADE,
PRIMARY KEY (antonym, senseID)
);
CREATE TABLE PhraseSearch_WordSense_Source (
language TEXT NOT NULL,
word TEXT,
senseID INTEGER NOT NULL,
FOREIGN KEY(senseID) REFERENCES PhraseSearch_WordSense(id) ON DELETE CASCADE,
PRIMARY KEY (language, senseID)
);
CREATE TABLE PhraseSearch_WordSense_Info (
info TEXT NOT NULL,
senseID INTEGER NOT NULL,
FOREIGN KEY(senseID) REFERENCES PhraseSearch_WordSense(id) ON DELETE CASCADE,
PRIMARY KEY (info, senseID)
);
CREATE TABLE PhraseSearch_WordSense_Restriction (
restriction TEXT NOT NULL,
senseID INTEGER NOT NULL,
FOREIGN KEY(senseID) REFERENCES PhraseSearch_WordSense(id) ON DELETE CASCADE,
PRIMARY KEY (restriction, senseID)
);
CREATE TABLE PhraseSearch_Attribution (
jmdict BOOLEAN NOT NULL,
jmnedict BOOLEAN NOT NULL,
dbpedia TEXT,
resultSlug TEXT NOT NULl PRIMARY KEY,
FOREIGN KEY(resultSlug) REFERENCES PhraseSearch_JishoResult(slug) ON DELETE CASCADE
);

View File

@ -0,0 +1,253 @@
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (1, '', 1, 'one');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (2, '', 1, 'line');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (3, '', 1, 'dot');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (4, '', 1, 'slash');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (5, '', 1, 'second');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (6, '', 1, 'hook');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (7, '', 2, 'two');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (8, '', 2, 'lid');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (9, '', 2, 'man, human');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (10, '', 2, 'man, human', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (11, '𠆢', 2, 'man, human', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (12, '', 2, 'legs');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (13, '', 2, 'enter');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (14, '', 2, 'eight');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (15, '', 2, 'eight', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (16, '', 2, 'open country');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (17, '', 2, 'cover');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (18, '', 2, 'ice');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (19, '', 2, 'table');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (20, '', 2, 'container, open mouth');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (21, '', 2, 'knife, sword');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (22, '', 2, 'knife, sword', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (23, '', 2, 'power, force');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (24, '', 2, 'wrap, embrace');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (25, '', 2, 'spoon');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (26, '', 2, 'box');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (27, '', 2, 'ten, complete');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (28, '', 2, 'divination');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (29, '', 2, 'kneel');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (30, '', 2, 'cliff');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (31, '', 2, 'private');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (32, '', 2, 'right hand');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (33, '', 2, 'Katakana, Jisho search radical');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (34, '', 2, 'second');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (35, '', 2, 'Katakana, Jisho search radical');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (36, '', 2, 'slash');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (360, '𠂉', 2, 'slash', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (37, '', 3, 'walk', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (38, '', 3, 'mouth, opening');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (39, '', 3, 'enclosure');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (40, '', 3, 'earth');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (41, '', 3, 'scholar, bachelor');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (42, '', 3, 'go');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (43, '', 3, 'evening, sunset');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (44, '', 3, 'big, very');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (45, '', 3, 'woman, female');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (46, '', 3, 'child, seed');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (47, '', 3, 'roof');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (48, '', 3, 'thumb, inch');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (49, '', 3, 'small, insignificant');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (50, '', 3, 'small, insignificant', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (51, '', 3, 'lame');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (52, '', 3, 'corpse');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (53, '', 3, 'sprout');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (54, '', 3, 'mountain');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (55, '', 3, 'river');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (56, '', 3, 'river');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (57, '', 3, 'work');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (58, '', 3, 'oneself');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (59, '', 3, 'turban, scarf');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (60, '', 3, 'pestle');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (61, '', 3, 'short, tiny');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (62, '广', 3, 'house on cliff');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (63, '', 3, 'long stride');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (64, '', 3, 'two hands, twenty');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (65, '', 3, 'shoot, arrow');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (66, '', 3, 'bow');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (67, '', 3, 'pig snout');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (68, '', 3, 'pig snout');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (69, '', 3, 'bristle, beard');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (70, '', 3, 'step');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (71, '', 3, 'heart', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (72, '', 3, 'hand', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (73, '', 3, 'water', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (74, '', 3, 'dog', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (75, '', 3, 'grass', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (76, '', 3, 'town (阝 right)', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (77, '', 3, 'mound, dam (阝 left)', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (78, '', 3, 'second');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (79, '', 3, 'lid');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (80, '', 3, 'right hand');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (81, '', 3, 'slash');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (82, '', 4, 'old', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (83, '', 4, 'heart');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (84, '', 4, 'spear, halberd');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (85, '', 4, 'door, house');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (86, '', 4, 'hand');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (87, '', 4, 'branch');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (88, '', 4, 'rap');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (89, '', 4, 'script, literature');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (90, '', 4, 'dipper');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (91, '', 4, 'axe');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (92, '', 4, 'square');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (93, '', 4, 'perish');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (94, '', 4, 'sun, day');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (95, '', 4, 'say');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (96, '', 4, 'moon, month');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (97, '', 4, 'tree');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (98, '', 4, 'lack, yawn');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (99, '', 4, 'stop');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (100, '', 4, 'death, decay');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (101, '', 4, 'weapon, lance');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (102, '', 4, 'compare, compete');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (103, '', 4, 'fur, hair');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (104, '', 4, 'clan');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (105, '', 4, 'steam, breath');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (106, '', 4, 'water');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (107, '', 4, 'fire');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (108, '', 4, 'fire', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (109, '', 4, 'claw');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (110, '', 4, 'father');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (111, '', 4, 'mix, twine, cross');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (112, '', 4, 'split wood');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (113, '', 4, 'slice');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (114, '', 4, 'cow');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (115, '', 4, 'dog');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (116, '', 4, 'sign', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (117, '', 4, 'jade (king)');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (118, '', 4, 'legs');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (119, '', 4, 'two');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (120, '', 4, 'wrap, embrace');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (121, '', 4, 'lame');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (122, '', 4, 'two');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (123, '', 4, 'sprout');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (124, '', 4, 'oneself');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (125, '', 4, 'mother, do not');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (126, '', 5, 'dark, profound');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (127, '', 5, 'tile');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (128, '', 5, 'sweet');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (129, '', 5, 'life');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (130, '', 5, 'use');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (131, '', 5, 'field');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (132, '', 5, 'bolt of cloth');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (133, '', 5, 'sickness', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (134, '', 5, 'footsteps');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (135, '', 5, 'white');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (136, '', 5, 'skin');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (137, '', 5, 'dish');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (138, '', 5, 'eye');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (139, '', 5, 'spear');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (140, '', 5, 'arrow');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (141, '', 5, 'stone');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (142, '', 5, 'sign');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (143, '', 5, 'track', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (144, '', 5, 'grain');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (145, '', 5, 'cave');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (146, '', 5, 'stand, erect');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (147, '', 5, 'clothes', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (148, '', 5, 'one');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (149, '', 5, 'work');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (150, '', 5, 'open country');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (151, '', 5, 'mother, do not');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (152, '', 5, 'net', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (153, '', 5, 'fang');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (154, '', 6, 'melon');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (155, '', 6, 'bamboo');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (156, '', 6, 'rice');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (157, '', 6, 'silk');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (158, '', 6, 'jar');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (159, '', 6, 'sheep');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (160, '', 6, 'feather');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (161, '', 6, 'beard');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (162, '', 6, 'plow');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (163, '', 6, 'ear');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (164, '', 6, 'brush');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (165, '', 6, 'meat');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (166, '', 6, 'self');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (167, '', 6, 'arrive');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (168, '', 6, 'mortar');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (169, '', 6, 'tongue');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (170, '', 6, 'boat');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (171, '', 6, 'stopping');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (172, '', 6, 'colour, prettiness');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (173, '', 6, 'tiger stripes');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (174, '', 6, 'insect');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (175, '', 6, 'blood');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (176, '', 6, 'go, do');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (177, '', 6, 'clothes');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (178, '西', 6, 'west');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (179, '', 7, 'minster, official');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (180, '', 7, 'see');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (181, '', 7, 'horn');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (182, '', 7, 'speech');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (183, '', 7, 'valley');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (184, '', 7, 'bean');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (185, '', 7, 'pig');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (186, '', 7, 'cat, badger');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (187, '', 7, 'shell');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (188, '', 7, 'red, naked');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (189, '', 7, 'run');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (190, '', 7, 'foot');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (191, '', 7, 'body');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (192, '', 7, 'cart, car');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (193, '', 7, 'bitter');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (194, '', 7, 'morning');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (195, '', 7, 'wine, alcohol');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (196, '', 7, 'divide, distinguish, choose');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (197, '', 7, 'village, mile');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (198, '', 7, 'opposite');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (199, '', 7, 'wheat');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (200, '', 8, 'metal, gold');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (201, '', 8, 'long, grow');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (202, '', 8, 'gate');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (203, '', 8, 'slave, capture');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (204, '', 8, 'small bird');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (205, '', 8, 'rain');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (206, '', 8, 'blue');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (207, '', 8, 'wrong');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (208, '', 8, 'big, very');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (209, '', 8, 'mountain');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (210, '', 8, 'legs');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (211, '', 8, 'script, literature');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (212, '', 9, 'face');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (213, '', 9, 'leather, rawhide');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (214, '', 9, 'leek');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (215, '', 9, 'sound');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (216, '', 9, 'leaf');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (217, '', 9, 'wind');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (218, '', 9, 'fly');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (219, '', 9, 'eat, food');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (220, '', 9, 'head');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (221, '', 9, 'fragrance');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (222, '', 9, 'mouth, opening');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (223, '', 10, 'horse');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (224, '', 10, 'bone');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (225, '', 10, 'tall');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (226, '', 10, 'long hair');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (227, '', 10, 'fight');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (228, '', 10, 'herbs, sacrificial wine');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (229, '', 10, 'tripod, cauldron');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (230, '', 10, 'ghost, demon');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (231, '', 10, 'stand, erect');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (232, '', 10, 'tanned leather');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (233, '', 11, 'fish');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (234, '', 11, 'bird');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (235, '', 11, 'salt');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (236, '鹿', 11, 'deer');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (237, '', 11, 'hemp, flax');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (238, '', 11, 'second');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) VALUES (239, '', 11, 'mouth, opening', '');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (240, '', 11, 'yellow');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (241, '', 11, 'black');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (242, '', 12, 'millet');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (243, '', 12, 'embroidery, needlework');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (244, '', 12, 'fire');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (245, '', 12, 'stop');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (246, '', 13, 'frog, amphibian');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (247, '', 13, 'tripod');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (248, '', 13, 'drum');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (249, '', 13, 'rat, mouse');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (250, '', 14, 'nose');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (251, '', 14, 'even, uniformly');
INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) VALUES (252, '', 17, 'flute');

9
lib/migrations/Makefile Normal file
View File

@ -0,0 +1,9 @@
DB_NAME=test.db
all: clean
sqlite3 $(DB_NAME) < 0001_initial.sql
sqlite3 $(DB_NAME) < 0002_populate_radicals.sql
python test.py
clean:
rm test.db || true

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1 @@
一右雨円王音下火花貝学気九休玉金空月犬見五口校左三山子四糸字耳七車手十出女小上森人水正生青夕石赤千川先早草足村大男竹中虫町天田土二日入年白八百文木本名目立力林六

View File

@ -0,0 +1 @@
引羽雲園遠何科夏家歌画回会海絵外角楽活間丸岩顔汽記帰弓牛魚京強教近兄形計元言原戸古午後語工公広交光考行高黄合谷国黒今才細作算止市矢姉思紙寺自時室社弱首秋週春書少場色食心新親図数西声星晴切雪船線前組走多太体台地池知茶昼長鳥朝直通弟店点電刀冬当東答頭同道読内南肉馬売買麦半番父風分聞米歩母方北毎妹万明鳴毛門夜野友用曜来里理話

View File

@ -0,0 +1 @@
悪安暗医委意育員院飲運泳駅央横屋温化荷界開階寒感漢館岸起期客究急級宮球去橋業曲局銀区苦具君係軽血決研県庫湖向幸港号根祭皿仕死使始指歯詩次事持式実写者主守取酒受州拾終習集住重宿所暑助昭消商章勝乗植申身神真深進世整昔全相送想息速族他打対待代第題炭短談着注柱丁帳調追定庭笛鉄転都度投豆島湯登等動童農波配倍箱畑発反坂板皮悲美鼻筆氷表秒病品負部服福物平返勉放味命面問役薬由油有遊予羊洋葉陽様落流旅両緑礼列練路和

View File

@ -0,0 +1 @@
愛案以衣位茨印英栄媛塩岡億加果貨課芽賀改械害街各覚潟完官管関観願岐希季旗器機議求泣給挙漁共協鏡競極熊訓軍郡群径景芸欠結建健験固功好香候康佐差菜最埼材崎昨札刷察参産散残氏司試児治滋辞鹿失借種周祝順初松笑唱焼照城縄臣信井成省清静席積折節説浅戦選然争倉巣束側続卒孫帯隊達単置仲沖兆低底的典伝徒努灯働特徳栃奈梨熱念敗梅博阪飯飛必票標不夫付府阜富副兵別辺変便包法望牧末満未民無約勇要養浴利陸良料量輪類令冷例連老労録

View File

@ -0,0 +1 @@
圧囲移因永営衛易益液演応往桜可仮価河過快解格確額刊幹慣眼紀基寄規喜技義逆久旧救居許境均禁句型経潔件険検限現減故個護効厚耕航鉱構興講告混査再災妻採際在財罪殺雑酸賛士支史志枝師資飼示似識質舎謝授修述術準序招証象賞条状常情織職制性政勢精製税責績接設絶祖素総造像増則測属率損貸態団断築貯張停提程適統堂銅導得毒独任燃能破犯判版比肥非費備評貧布婦武復複仏粉編弁保墓報豊防貿暴脈務夢迷綿輸余容略留領歴

View File

@ -0,0 +1 @@
胃異遺域宇映延沿恩我灰拡革閣割株干巻看簡危机揮貴疑吸供胸郷勤筋系敬警劇激穴券絹権憲源厳己呼誤后孝皇紅降鋼刻穀骨困砂座済裁策冊蚕至私姿視詞誌磁射捨尺若樹収宗就衆従縦縮熟純処署諸除承将傷障蒸針仁垂推寸盛聖誠舌宣専泉洗染銭善奏窓創装層操蔵臓存尊退宅担探誕段暖値宙忠著庁頂腸潮賃痛敵展討党糖届難乳認納脳派拝背肺俳班晩否批秘俵腹奮並陛閉片補暮宝訪亡忘棒枚幕密盟模訳郵優預幼欲翌乱卵覧裏律臨朗論

View File

@ -0,0 +1 @@
亜哀挨曖握扱宛嵐依威為畏尉萎偉椅彙違維慰緯壱逸芋咽姻淫陰隠韻唄鬱畝浦詠影鋭疫悦越謁閲炎怨宴援煙猿鉛縁艶汚凹押旺欧殴翁奥憶臆虞乙俺卸穏佳苛架華菓渦嫁暇禍靴寡箇稼蚊牙瓦雅餓介戒怪拐悔皆塊楷潰壊懐諧劾崖涯慨蓋該概骸垣柿核殻郭較隔獲嚇穫岳顎掛括喝渇葛滑褐轄且釜鎌刈甘汗缶肝冠陥乾勘患貫喚堪換敢棺款閑勧寛歓監緩憾還環韓艦鑑含玩頑企伎忌奇祈軌既飢鬼亀幾棋棄毀畿輝騎宜偽欺儀戯擬犠菊吉喫詰却脚虐及丘朽臼糾嗅窮巨拒拠虚距御凶叫狂享況峡挟狭恐恭脅矯響驚仰暁凝巾斤菌琴僅緊錦謹襟吟駆惧愚偶遇隅串屈掘窟繰勲薫刑茎契恵啓掲渓蛍傾携継詣慶憬稽憩鶏迎鯨隙撃桁傑肩倹兼剣拳軒圏堅嫌献遣賢謙鍵繭顕懸幻玄弦舷股虎孤弧枯雇誇鼓錮顧互呉娯悟碁勾孔巧甲江坑抗攻更拘肯侯恒洪荒郊貢控梗喉慌硬絞項溝綱酵稿衡購乞拷剛傲豪克酷獄駒込頃昆恨婚痕紺魂墾懇沙唆詐鎖挫采砕宰栽彩斎債催塞歳載剤削柵索酢搾錯咲刹拶撮擦桟惨傘斬暫旨伺刺祉肢施恣脂紫嗣雌摯賜諮侍慈餌璽軸𠮟疾執湿嫉漆芝赦斜煮遮邪蛇酌釈爵寂朱狩殊珠腫趣寿呪需儒囚舟秀臭袖羞愁酬醜蹴襲汁充柔渋銃獣叔淑粛塾俊瞬旬巡盾准殉循潤遵庶緒如叙徐升召匠床抄肖尚昇沼宵症祥称渉紹訟掌晶焦硝粧詔奨詳彰憧衝償礁鐘丈冗浄剰畳壌嬢錠譲醸拭殖飾触嘱辱尻伸芯辛侵津唇娠振浸紳診寝慎審震薪刃尽迅甚陣尋腎須吹炊帥粋衰酔遂睡穂随髄枢崇据杉裾瀬是姓征斉牲凄逝婿誓請醒斥析脊隻惜戚跡籍拙窃摂仙占扇栓旋煎羨腺詮践箋潜遷薦繊鮮禅漸膳繕狙阻租措粗疎訴塑遡礎双壮荘捜挿桑掃曹曽爽喪痩葬僧遭槽踪燥霜騒藻憎贈即促捉俗賊遜汰妥唾堕惰駄耐怠胎泰堆袋逮替滞戴滝択沢卓拓託濯諾濁但脱奪棚誰丹旦胆淡嘆端綻鍛弾壇恥致遅痴稚緻畜逐蓄秩窒嫡抽衷酎鋳駐弔挑彫眺釣貼超跳徴嘲澄聴懲勅捗沈珍朕陳鎮椎墜塚漬坪爪鶴呈廷抵邸亭貞帝訂逓偵堤艇締諦泥摘滴溺迭哲徹撤添塡殿斗吐妬途渡塗賭奴怒到逃倒凍唐桃透悼盗陶塔搭棟痘筒稲踏謄藤闘騰洞胴瞳峠匿督篤凸突屯豚頓貪鈍曇丼那謎鍋軟尼弐匂虹尿妊忍寧捻粘悩濃把覇婆罵杯排廃輩培陪媒賠伯拍泊迫剝舶薄漠縛爆箸肌鉢髪伐抜罰閥氾帆汎伴畔般販斑搬煩頒範繁藩蛮盤妃彼披卑疲被扉碑罷避尾眉微膝肘匹泌姫漂苗描猫浜賓頻敏瓶扶怖附訃赴浮符普腐敷膚賦譜侮舞封伏幅覆払沸紛雰噴墳憤丙併柄塀幣弊蔽餅壁璧癖蔑偏遍哺捕舗募慕簿芳邦奉抱泡胞俸倣峰砲崩蜂飽褒縫乏忙坊妨房肪某冒剖紡傍帽貌膨謀頰朴睦僕墨撲没勃堀奔翻凡盆麻摩磨魔昧埋膜枕又抹慢漫魅岬蜜妙眠矛霧娘冥銘滅免麺茂妄盲耗猛網黙紋冶弥厄躍闇喩愉諭癒唯幽悠湧猶裕雄誘憂融与誉妖庸揚揺溶腰瘍踊窯擁謡抑沃翼拉裸羅雷頼絡酪辣濫藍欄吏痢履璃離慄柳竜粒隆硫侶虜慮了涼猟陵僚寮療瞭糧厘倫隣瑠涙累塁励戻鈴零霊隷齢麗暦劣烈裂恋廉錬呂炉賂露弄郎浪廊楼漏籠麓賄脇惑枠湾腕

View File

@ -0,0 +1 @@
氏統保第結派案策基価提挙応企検藤沢裁証援施井護展態鮮視条幹独宮率衛張監環審義訴株姿閣衆評影松撃佐核整融製票渉響推請器士討攻崎督授催及憲離激摘系批郎健盟従修隊織拡故振弁就異献厳維浜遺塁邦素遣抗模雄益緊標宣昭廃伊江僚吉盛皇臨踏壊債興源儀創障継筋闘葬避司康善逮迫惑崩紀聴脱級博締救執房撤削密措志載陣我為抑幕染奈傷択秀徴弾償功拠秘拒刑塚致繰尾描鈴盤項喪伴養懸街契掲躍棄邸縮還属慮枠恵露沖緩節需射購揮充貢鹿却端賃獲郡併徹貴衝焦奪災浦析譲称納樹挑誘紛至宗促慎控智握宙俊銭渋銃操携診託撮誕侵括謝駆透津壁稲仮裂敏是排裕堅訳芝綱典賀扱顧弘看訟戒祉誉歓奏勧騒閥甲縄郷揺免既薦隣華範隠徳哲杉釈己妥威豪熊滞微隆症暫忠倉彦肝喚沿妙唱阿索誠襲懇俳柄驚麻李浩剤瀬趣陥斎貫仙慰序旬兼聖旨即柳舎偽較覇詳抵脅茂犠旗距雅飾網竜詩繁翼潟敵魅嫌斉敷擁圏酸罰滅礎腐脚潮梅尽僕桜滑孤炎賠句鋼頑鎖彩摩励縦輝蓄軸巡稼瞬砲噴誇祥牲秩帝宏唆阻泰賄撲堀菊絞縁唯膨矢耐塾漏慶猛芳懲剣彰棋丁恒揚冒之倫陳憶潜梨仁克岳概拘墓黙須偏雰遇諮狭卓亀糧簿炉牧殊殖艦輩穴奇慢鶴謀暖昌拍朗寛覆胞泣隔浄没暇肺貞靖鑑飼陰銘随烈尋稿丹啓也丘棟壌漫玄粘悟舗妊熟旭恩騰往豆遂狂岐陛緯培衰艇屈径淡抽披廷錦准暑磯奨浸剰胆繊駒虚霊帳悔諭惨虐翻墜沼据肥徐糖搭盾脈滝軌俵妨擦鯨荘諾雷漂懐勘栽拐駄添冠斜鏡聡浪亜覧詐壇勲魔酬紫曙紋卸奮欄逸涯拓眼獄尚彫穏顕巧矛垣欺釣萩粛栗愚嘉遭架鬼庶稚滋幻煮姫誓把践呈疎仰剛疾征砕謡嫁謙后嘆菌鎌巣頻琴班棚潔酷宰廊寂辰霞伏碁俗漠邪晶墨鎮洞履劣那殴娠奉憂朴亭淳怪鳩酔惜穫佳潤悼乏該赴桑桂髄虎盆晋穂壮堤飢傍疫累痴搬晃癒桐寸郭尿凶吐宴鷹賓虜陶鐘憾猪紘磁弥昆粗訂芽庄傘敦騎寧循忍怠如寮祐鵬鉛珠凝苗獣哀跳匠垂蛇澄縫僧眺亘呉凡憩媛溝恭刈睡錯伯笹穀陵霧魂弊妃舶餓窮掌麗綾臭悦刃縛暦宜盲粋辱毅轄猿弦稔窒炊洪摂飽冗桃狩朱渦紳枢碑鍛刀鼓裸猶塊旋弓幣膜扇腸槽慈楊伐駿漬糾亮墳坪紺娯椿舌羅峡俸厘峰圭醸蓮弔乙汁尼遍衡薫猟羊款閲偵喝敢胎酵憤豚遮扉硫赦窃泡瑞又慨紡恨肪扶戯伍忌濁奔斗蘭迅肖鉢朽殻享秦茅藩沙輔媒鶏禅嘱胴迭挿嵐椎絹陪剖譜郁悠淑帆暁傑楠笛玲奴錠拳翔遷拙侍尺峠篤肇渇叔雌亨堪叙酢吟逓嶺甚喬崇漆岬癖愉寅礁乃洲屯樺槙姻巌擬塀唇睦閑胡幽峻曹詠卑侮鋳抹尉槻隷禍蝶酪茎帥逝汽琢匿襟蛍蕉寡琉痢庸朋坑藍賊搾畔遼唄孔橘漱呂拷嬢苑巽杜渓翁廉謹瞳湧欣窯褒醜升殉煩巴禎劾租堕桟稜婿倭斐慕矯罷囚某虹魁泌鴻赳於蚊漸厄葵禄藻嫡孟嚇尭凸巳韻暢硝霜芹勅棺杏鳳儒慧馨楼愁匡彬欽眉褐薪嵯賜繕綜翠栓榛鮎艶凹蔦惣隼錬衷渚斥逐芙稀皐詔惟雛耀佑渥黛宵憧惇妄甫脩蚕酌蒼嬉頒暉肢只凱檀謄彗丑梓叶嗣絢汐伽朔抄畝黎爽蛮惰旺冴偲萌瑠壱侯允鯉蒔遥弧瑛舜彪附但卯芋綺凌茜洸皓婆毬鯛緋邑怜碧倣穣啄悌酉柚倹亦繭采詢賦紗玖眸錘弐倖諄笙痘裟侃爾洵昴耗莞銑碩伶滉宥伎晏迪朕且綸晨竣燦吏頌麿楓箇梧琳澪哉晟匁凪衿丙梢茄颯恕勺瑚蕗瞭遵虞燎侑柊斤謁捺嵩茉蓉燿袈冶誼墾栞菖勁椋旦紬叡凜胤爵亥麟脹汰莉瑳瑶椰耶丞絃奎璃昂塑熙柾諒菫崚鞠捷濫

View File

@ -0,0 +1 @@
党協総区領県設改府査委軍団各島革村勢減再税営比防補境導副算輸述線農州武象域額欧担準賞辺造被技低復移個門課脳極含蔵量型況針専谷史階管兵接細効丸湾録省旧橋岸周材戸央券編捜竹超並療採森競介根販歴将幅般貿講林装諸劇河航鉄児禁印逆換久短油暴輪占植清倍均億圧芸署伸停爆陸玉波帯延羽固則乱普測豊厚齢囲卒略承順岩練軽了庁城患層版令角絡損募裏仏績築貨混昇池血温季星永著誌庫刊像香坂底布寺宇巨震希触依籍汚枚複郵仲栄札板骨傾届巻燃跡包駐弱紹雇替預焼簡章臓律贈照薄群秒奥詰双刺純翌快片敬悩泉皮漁荒貯硬埋柱祭袋筆訓浴童宝封胸砂塩賢腕兆床毛緑尊祝柔殿濃液衣肩零幼荷泊黄甘臣浅掃雲掘捨軟沈凍乳恋紅郊腰炭踊冊勇械菜珍卵湖喫干虫刷湯溶鉱涙匹孫鋭枝塗軒毒叫拝氷乾棒祈拾粉糸綿汗銅湿瓶咲召缶隻脂蒸肌耕鈍泥隅灯辛磨麦姓筒鼻粒詞胃畳机膚濯塔沸灰菓帽枯涼舟貝符憎皿肯燥畜挟曇滴伺

View File

@ -0,0 +1 @@
政議民連対部合市内相定回選米実関決全表戦経最現調化当約首法性要制治務成期取都和機平加受続進数記初指権支産点報済活原共得解交資予向際勝面告反判認参利組信在件側任引求所次昨論官増係感情投示変打直両式確果容必演歳争談能位置流格疑過局放常状球職与供役構割費付由説難優夫収断石違消神番規術備宅害配警育席訪乗残想声念助労例然限追商葉伝働形景落好退頭負渡失差末守若種美命福望非観察段横深申様財港識呼達良候程満敗値突光路科積他処太客否師登易速存飛殺号単座破除完降責捕危給苦迎園具辞因馬愛富彼未舞亡冷適婦寄込顔類余王返妻背熱宿薬険頼覚船途許抜便留罪努精散静婚喜浮絶幸押倒等老曲払庭徒勤遅居雑招困欠更刻賛抱犯恐息遠戻願絵越欲痛笑互束似列探逃遊迷夢君閉緒折草暮酒悲晴掛到寝暗盗吸陽御歯忘雪吹娘誤洗慣礼窓昔貧怒泳祖杯疲皆鳴腹煙眠怖耳頂箱晩寒髪忙才靴恥偶偉猫幾

View File

@ -0,0 +1 @@
会同事自社発者地業方新場員立開手力問代明動京目通言理体田主題意不作用度強公持野以思家世多正安院心界教文元重近考画海売知道集別物使品計死特私始朝運終台広住真有口少町料工建空急止送切転研足究楽起着店病質待試族銀早映親験英医仕去味写字答夜音注帰古歌買悪図週室歩風紙黒花春赤青館屋色走秋夏習駅洋旅服夕借曜飲肉貸堂鳥飯勉冬昼茶弟牛魚兄犬妹姉漢

View File

@ -0,0 +1 @@
日一国人年大十二本中長出三時行見月後前生五間上東四今金九入学高円子外八六下来気小七山話女北午百書先名川千水半男西電校語土木聞食車何南万毎白天母火右読友左休父雨

133
lib/migrations/test.py Normal file
View File

@ -0,0 +1,133 @@
import sqlite3
import json
# returns id
def insert_radical(cursor, item) -> str:
if 'radical' in item:
dataId = cursor.execute(
'INSERT OR IGNORE INTO Kanji_Radical(symbol, meaning) VALUES (?, ?)',
(item['radical']['symbol'], item['radical']['meaning'])
)
if 'forms' in item['radical']:
for form in item['radical']['forms']:
cursor.execute(
'INSERT OR IGNORE INTO Kanji_Radical_Forms(form, radical) VALUES (?, ?)',
(form, item['radical']['symbol'])
)
return item['radical']['symbol']
return None
def insert_kanji(cursor, item):
cursor.execute(
"""
INSERT OR IGNORE INTO Kanji_Result(
kanji,
strokeCount,
meaning,
radical
)
VALUES (?,?,?,?)
""",
(
item['query'],
item['strokeCount'],
item['meaning'],
item['radical']['symbol'],
)
)
for column in ['jlptLevel', 'newspaperFrequencyRank', 'taughtIn']:
if (column in item):
cursor.execute(
f'UPDATE Kanji_Result SET {column} = ? WHERE kanji = ?',
(item[column], item['query'])
)
def insert_yomi(cursor, item, on=True):
yomiName = 'Onyomi' if on else 'Kunyomi'
for yomi in item[yomiName.lower()]:
cursor.execute(
f"""
INSERT OR IGNORE INTO Kanji_{yomiName}(yomi)
VALUES (?)
""",
(yomi,)
)
cursor.execute(
f"""
INSERT OR IGNORE INTO Kanji_Result{yomiName}_XRef(yomi, kanji)
VALUES (?, ?)
""",
(yomi, item['query'])
)
def insert_yomi_examples(cursor, item, on=True):
yomiName = 'Onyomi' if on else 'Kunyomi'
for yomiExample in item[yomiName.lower() + 'Examples']:
cursor.execute(
f"""
INSERT OR IGNORE INTO Kanji_YomiExample(example, reading, meaning)
VALUES (?, ?, ?)
""",
(yomiExample['example'], yomiExample['reading'], yomiExample['meaning'])
)
cursor.execute(
f"""
INSERT OR IGNORE INTO Kanji_Result{yomiName}Example_XRef(exampleID, kanji)
VALUES (?, ?)
""",
(cursor.lastrowid, item['query'])
)
def insert_parts(cursor, item):
for part in item['parts']:
cursor.execute(
"""
INSERT OR IGNORE INTO Kanji_Part(part)
VALUES (?)
""",
(part,)
)
cursor.execute(
"""
INSERT OR IGNORE INTO Kanji_ResultPart_XRef(part, kanji)
VALUES (?, ?)
""",
(part, item['query'])
)
def insertYomiExamples(cursor, item, on=True):
yomiName = 'Onyomi' if on else 'Kunyomi'
for yomi in item[yomiName.lower()]:
cursor.execute(
f"""
INSERT OR IGNORE INTO Kanji_{yomiName}(yomi)
VALUES (?)
""",
(yomi,)
)
cursor.execute(
f"""
INSERT OR IGNORE INTO Kanji_Result{yomiName}_XRef(yomi, kanji)
VALUES (?, ?)
""",
(yomi, item['query'])
)
with sqlite3.connect("test.db") as connection:
cursor = connection.cursor()
for grade in range(1, 8):
with open(f'data/jisho/grade{grade}.json') as file:
data = json.loads(file.read())
for item in data:
rad = insert_radical(cursor, item)
insert_kanji(cursor, item)
insert_yomi(cursor, item, on=True)
insert_yomi(cursor, item, on=False)
insert_yomi_examples(cursor, item, on=True)
insert_yomi_examples(cursor, item, on=False)
insert_parts(cursor, item)

View File

@ -0,0 +1,138 @@
import 'package:html/parser.dart';
import 'package:http/http.dart' as http;
import 'package:unofficial_jisho_api/api.dart';
// TODO: Clean up code and automate process.
class Radical {
final int id;
final String symbol;
final String? search_symbol;
final String meaning;
final int strokes;
const Radical({
required this.id,
required this.symbol,
required this.strokes,
required this.meaning,
this.search_symbol,
});
@override
String toString() {
return '$id - ($symbol, $strokes${search_symbol != null ? ", $search_symbol" : ""})';
}
String get sql_insert => search_symbol == null
? 'INSERT INTO Kanji_Radical (id, symbol, strokes, meaning) '
"VALUES ($id, '$symbol', $strokes, '$meaning');"
: 'INSERT INTO Kanji_Radical (id, symbol, strokes, meaning, searchSymbol) '
"VALUES ($id, '$symbol', $strokes, '$meaning', '$search_symbol');";
}
String hexToUnicode(String code) =>
String.fromCharCode(int.parse(code, radix: 16));
/// Some of the radicals in jisho are written using katakana,
/// and some are written using either the symbols from the
/// Kangxi radical block (U+2F00-U+2FDF) or the
/// Unified CJK Character block (U+4E00-U+9FFF). These have been
/// used without care, and therefore some of the radicals are not
/// easily searchable. This conversion table helps solve this issue.
///
/// See:
/// https://en.wikipedia.org/wiki/List_of_radicals_in_Unicode
/// https://second.wiki/wiki/unicodeblock_kangxi-radikale
/// https://wiki.contextgarden.net/List_of_Unicode_blocks
Future<Map<String, String>> fetchEquivalentUCJKIdeographs() async {
final response = await http.get(
Uri.parse(
'https://www.unicode.org/Public/UNIDATA/EquivalentUnifiedIdeograph.txt',
),
);
final Map<String, String> result = {};
for (final line in response.body.split('\n')) {
if (line.startsWith('#') || RegExp(r'^\s*$').hasMatch(line)) continue;
final items = line.split(RegExp(r'\s+'));
if (items[0].contains('.')) {
final startEnd = items[0].split('..');
final start = int.parse(startEnd[0], radix: 16);
final end = int.parse(startEnd[1], radix: 16);
for (int i = 0; i <= (end - start); i++) {
result[String.fromCharCode(start + i)] = hexToUnicode(items[2]);
}
} else {
result[hexToUnicode(items[0])] = hexToUnicode(items[2]);
}
}
return result;
}
Future<void> main(List<String> args) async {
final Map<String, String> equivalentSymbols =
await fetchEquivalentUCJKIdeographs();
equivalentSymbols[''] = '';
equivalentSymbols[''] = '丿';
equivalentSymbols[''] = '';
equivalentSymbols[''] = '';
equivalentSymbols[''] = '';
final Map<String, List<String>> inverseEquivalentSymbols = {};
for (final entry in equivalentSymbols.entries) {
if (inverseEquivalentSymbols.containsKey(entry.value)) {
inverseEquivalentSymbols[entry.value]!.add(entry.key);
continue;
}
inverseEquivalentSymbols[entry.value] = [entry.key];
}
final response = await http.get(Uri.parse('https://jisho.org/'));
final document = parse(response.body);
final table = document.querySelector('.radical_table')!;
final List<Radical> radicals = [];
int i = 0;
for (final node in table.children) {
if (node.className == 'reset_icon_list_item') continue;
if (node.className == 'number') {
i = int.parse(node.innerHtml);
continue;
}
final String radical = node.innerHtml;
// print(radical);
KanjiResult? result;
for (final item in [
radical,
equivalentSymbols[radical],
...inverseEquivalentSymbols[radical] ?? [],
]) {
if (item == null) continue;
result = await searchForKanji(item);
if (result.found) break;
}
final Radical radicalData = Radical(
id: int.parse(node.attributes['data-radical']!),
symbol: radical,
strokes: i,
search_symbol: node.attributes['data-radk'],
meaning: ['', ''].contains(radical)
? 'katakana, jisho search radical'
: result!.data!.radical!.meaning,
);
radicals.add(radicalData);
print(radicalData.sql_insert);
}
assert(radicals.length == 252, '[ERROR] Missing radicals!');
}