aboutsummaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-07-09 18:00:33 +0200
committerlonkaars <loek@pipeframe.xyz>2023-07-09 18:00:33 +0200
commit80b46d2f6152129f25f5734e4960cb7c15edfcf0 (patch)
tree191c528e5ed18c6c85091b5dadb152231cb857aa /db
parent1138ac8fc8764cf5cd987383a7a0332879be6cca (diff)
more deinflections + tests
Diffstat (limited to 'db')
-rw-r--r--db/dict/deinflections.sql78
1 files changed, 64 insertions, 14 deletions
diff --git a/db/dict/deinflections.sql b/db/dict/deinflections.sql
index 7d67b02..a4a35d5 100644
--- a/db/dict/deinflections.sql
+++ b/db/dict/deinflections.sql
@@ -142,23 +142,71 @@ insert into deinflection_temp values
('infl:potential', 'ありえる', 'ある', 'a', ''), -- exception
-- conditionals <https://guidetojapanese.org/learn/grammar/conditionals>
- ('infl:cond:ba', 'えば', 'う', 'a', 'u'),
- ('infl:cond:ba', 'けば', 'く', 'a', 'u'),
- ('infl:cond:ba', 'げば', 'ぐ', 'a', 'u'),
- ('infl:cond:ba', 'せば', 'す', 'a', 'u'),
- ('infl:cond:ba', 'てば', 'つ', 'a', 'u'),
- ('infl:cond:ba', 'ねば', 'ぬ', 'a', 'u'),
- ('infl:cond:ba', 'べば', 'ぶ', 'a', 'u'),
- ('infl:cond:ba', 'めば', 'む', 'a', 'u'),
- ('infl:cond:ba', 'れば', 'る', 'a', 'u ru'),
- ('infl:cond:ba', 'ければ', 'い', 'a', 'a'),
+ ('infl:cond:ba', 'えば', 'う', 'nt', 'u'),
+ ('infl:cond:ba', 'けば', 'く', 'nt', 'u'),
+ ('infl:cond:ba', 'げば', 'ぐ', 'nt', 'u'),
+ ('infl:cond:ba', 'せば', 'す', 'nt', 'u'),
+ ('infl:cond:ba', 'てば', 'つ', 'nt', 'u'),
+ ('infl:cond:ba', 'ねば', 'ぬ', 'nt', 'u'),
+ ('infl:cond:ba', 'べば', 'ぶ', 'nt', 'u'),
+ ('infl:cond:ba', 'めば', 'む', 'nt', 'u'),
+ ('infl:cond:ba', 'れば', 'る', 'nt', 'u ru'),
+ ('infl:cond:ba', 'ければ', 'い', 'nt', 'a'),
-- TODO: 〜であれば (deconjugates to です i think?)
('infl:cond:ra', 'ら', '', 'a', 'a'), -- TODO: constrain valid matches to after past conjugation?
-- obligation <https://guidetojapanese.org/learn/grammar/must>
- ('infl:must infl:negative', 'はだめ', '', 'a', 'a'), -- built-in negative because だめ can't be deconjugated
- ('infl:must', 'はいける', '', 'a', 'a'), -- はいけない -> positive
- ('infl:must', 'はなる', '', 'a', 'a'), -- はならない -> positive
+ ('infl:tmp:must:res infl:negative', 'だめ', '', 'a', 'ot'), -- built-in negative because だめ can't be deconjugated
+ ('infl:tmp:must:res', 'いける', '', 'a', 'ot'), -- はいけない -> positive (stored this way because obligatory could be in past)
+ ('infl:tmp:must:res', 'なる', '', 'a', 'ot'), -- はならない -> positive
+ ('infl:must', 'は', '', 'ot', 'a'), -- removes particle (negative -te + は + だめ/いけない/ならない)
+ ('infl:tmp:must:prt infl:must', 'と', '', 'ot', 'a'), -- removes particle (negative + と + だめ/いけない/ならない)
+ ('infl:must', 'ば', 'ば', 'ot', 'a'), -- removes ot rule, keeps 〜ば (negative + ば + だめ/いけない/ならない)
+ ('infl:must infl:tmp:must:prt', 'なくちゃ', 'なくて', 'a', 'a'), -- colloquial abbreviation
+ ('infl:must infl:tmp:must:prt', 'なきゃ', 'なければ', 'a', 'a'), -- colloquial abbreviation
+ ('infl:tmp:must:prt', 'ちゃ', 'ては', 'a', 'a'), -- colloquial abbreviation
+ ('infl:tmp:must:prt', 'じゃ', 'では', 'a', 'a'), -- colloquial abbreviation
+
+ -- ~tai endings <https://guidetojapanese.org/learn/grammar/desire>
+ ('infl:desire:itai', 'たい', 'る', 'i', 'ru'),
+ ('infl:desire:itai', 'いたい', 'う', 'i', 'u'),
+ ('infl:desire:itai', 'きたい', 'く', 'i', 'u'),
+ ('infl:desire:itai', 'ぎたい', 'ぐ', 'i', 'u'),
+ ('infl:desire:itai', 'したい', 'す', 'i', 'u'),
+ ('infl:desire:itai', 'ちたい', 'つ', 'i', 'u'),
+ ('infl:desire:itai', 'にたい', 'ぬ', 'i', 'u'),
+ ('infl:desire:itai', 'びたい', 'ぶ', 'i', 'u'),
+ ('infl:desire:itai', 'みたい', 'む', 'i', 'u'),
+ ('infl:desire:itai', 'りたい', 'る', 'i', 'u'),
+ ('infl:desire:itai', 'したい', 'する', 'i', 's'),
+ ('infl:desire:itai', 'きたい', 'くる', 'i', 'k'),
+ ('infl:desire:itai', '来たい', '来る', 'i', 'k'),
+
+ -- volitional form <https://guidetojapanese.org/learn/grammar/desire>
+ ('infl:desire:volitional', 'よう', 'る', 'a', 'ru'),
+ ('infl:desire:volitional', 'おう', 'う', 'a', 'u'),
+ ('infl:desire:volitional', 'こう', 'く', 'a', 'u'),
+ ('infl:desire:volitional', 'ごう', 'ぐ', 'a', 'u'),
+ ('infl:desire:volitional', 'そう', 'す', 'a', 'u'),
+ ('infl:desire:volitional', 'とう', 'つ', 'a', 'u'),
+ ('infl:desire:volitional', 'のう', 'ぬ', 'a', 'u'),
+ ('infl:desire:volitional', 'ぼう', 'ぶ', 'a', 'u'),
+ ('infl:desire:volitional', 'もう', 'む', 'a', 'u'),
+ ('infl:desire:volitional', 'ろう', 'る', 'a', 'u'),
+ ('infl:desire:volitional', 'しよう', 'する', 'a', 's'),
+ ('infl:desire:volitional', 'こよう', 'くる', 'a', 'k'),
+ ('infl:desire:volitional', '来よう', '来る', 'a', 'k'),
+
+ -- polite volitional <https://guidetojapanese.org/learn/grammar/desire>
+ ('infl:desire:volitional', 'ましょう', 'ます', 'nt', 'nt'),
+
+ -- TODO: making suggestions using the 「ば」 or 「たら」 conditional
+
+ -- attempt (〜みる) <https://guidetojapanese.org/learn/grammar/try>
+ ('infl:attempt:miru', 'みる', '', 'ru', 'a'),
+
+ -- attempt (〜とする) <https://guidetojapanese.org/learn/grammar/try>
+ ('infl:attempt:tosuru', 'とする', '', 's', 'a'),
-- auxiliary rules
('class:verb:suru-included', 'する', '', 's', ''); -- deconjugate suru verbs into stem
@@ -175,7 +223,9 @@ insert into rule_map values
(null, 'z', 1 << 4), -- ずる (zuru)
('infl:reason:adj:i', 'i', 1 << 5), -- 形容詞 (i-adjective)
(null, 'iru', 1 << 6), -- 〜いる (temporary iru for progressive tense)
- ('infl:reason:adj:na', 'na', 1 << 7); -- 形容動詞 (na-adjective)
+ ('infl:reason:adj:na', 'na', 1 << 7), -- 形容動詞 (na-adjective)
+ (null, 'ot', 1 << 8), -- (temporary rule for deconjugating obligatory endings)
+ (null, 'nt', (1 << 6) - 1); -- (utility no temp, allows anything but temporaries)
-- add tags to db
insert into deinflection_rules (mask, tag)