aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-07-10 17:06:16 +0200
committerlonkaars <loek@pipeframe.xyz>2023-07-10 17:06:16 +0200
commitf7bfb89d7f400b48539b6f0712040caa6c6d3165 (patch)
treec4510be796c96a5d53f8c4f94e95cc469fe71ea9
parenta3a81530a0a30ba02b5253b762e2ccd77d3b01fc (diff)
fix infinite loop caused by deinflection rules
-rw-r--r--db/dict/deinflections.sql33
1 files changed, 17 insertions, 16 deletions
diff --git a/db/dict/deinflections.sql b/db/dict/deinflections.sql
index e768d33..0dbe19c 100644
--- a/db/dict/deinflections.sql
+++ b/db/dict/deinflections.sql
@@ -142,26 +142,27 @@ insert into deinflection_temp values
('infl:potential', 'ありえる', 'ある', 'ru', ''), -- exception
-- conditionals <https://guidetojapanese.org/learn/grammar/conditionals>
- ('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'),
+ ('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'),
-- 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:tmp:must:res infl:negative', 'だめ', '', 'a', 'ot'), -- built-in negative because だめ can't be deconjugated
- ('infl:tmp:must:res', 'いける', '', 'ru', 'ot'), -- はいけない -> positive (stored this way because obligatory could be in past)
- ('infl:tmp:must:res', 'なる', '', 'u', '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 + ば + だめ/いけない/ならない)
+ -- TODO: manually write these out instead of splitting particle and suffix
+ ('infl:must infl:tmp:must:res infl:negative', 'だめ', '', 'a', 'ot'), -- built-in negative because だめ can't be deconjugated
+ ('infl:must infl:tmp:must:res', 'いける', '', 'ru', 'ot'), -- はいけない -> positive (stored this way because obligatory could be in past)
+ ('infl:must infl:tmp:must:res', 'なる', '', 'u', 'ot'), -- はならない -> positive
+ ('infl:must', 'は', '', 'ot', 'nt'), -- removes particle (negative -te + は + だめ/いけない/ならない)
+ ('infl:tmp:must:prt infl:must', 'と', '', 'ot', 'nt'), -- removes particle (negative + と + だめ/いけない/ならない)
+ -- ('infl:must', 'ば', 'ば', 'ot', 'a'), -- causes infinite loop
('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