From f0c12fb2847db4a14dc884c94379eed2f9860045 Mon Sep 17 00:00:00 2001 From: Krasimir Angelov Date: Mon, 19 Oct 2026 18:16:11 +0200 Subject: [PATCH] extensions by Codex --- src/japanese/CatJpn.gf | 15 +- src/japanese/ConjunctionJpn.gf | 28 +- src/japanese/ConstructionJpn.gf | 24 +- src/japanese/ExtraJpn.gf | 1 + src/japanese/GrammarJpn.gf | 3 +- src/japanese/NamesJpn.gf | 34 +++ src/japanese/NounJpn.gf | 109 +++++--- src/japanese/NumeralJpn.gf | 465 ++++++++++++++++---------------- src/japanese/ParadigmsJpn.gf | 67 +++-- src/japanese/QuestionJpn.gf | 8 +- src/japanese/ResJpn.gf | 55 ++-- src/japanese/SentenceJpn.gf | 4 + src/japanese/StructuralJpn.gf | 2 +- src/japanese/VerbJpn.gf | 23 ++ 14 files changed, 506 insertions(+), 332 deletions(-) create mode 100644 src/japanese/NamesJpn.gf diff --git a/src/japanese/CatJpn.gf b/src/japanese/CatJpn.gf index 5e28fa6ed..e1572f3fa 100644 --- a/src/japanese/CatJpn.gf +++ b/src/japanese/CatJpn.gf @@ -19,7 +19,7 @@ flags coding = utf8 ; s_plain_pred : Particle => Style => TTense => Polarity => Str ; changePolar : Bool} ; IP = {s_subj, s_obj : Style => Str ; anim : Animateness ; how8many : Bool} ; IComp = {s : Style => Str ; wh8re : Bool} ; - IDet = {s : Str ; n : Number ; how8many : Bool ; inclCard : Bool} ; + IDet = {s : Str ; n : Number ; how8many : Bool ; numType : NumType} ; IQuant = {s : Str} ; RCl = {s, pred : Animateness => Style => TTense => Polarity => Str ; te, pred_te, pred_ba : Animateness => Style => Polarity => Str ; @@ -32,9 +32,11 @@ flags coding = utf8 ; -- needSubject : Bool} ; Comp = {verb : Animateness => Style => TTense => Polarity => Str ; a_stem, i_stem : Animateness => Style => Str ; te, ba : Animateness => Style => Polarity => Str ; - obj : Style => Str ; prepositive : Style => Str ; needSubject : Bool} ; + obj, comparison : Style => Str ; prepositive : Style => Str ; needSubject : Bool} ; VPSlash = {s : Speaker => Style => TTense => Polarity => Str ; + pass : Speaker => Style => TTense => Polarity => Str ; a_stem, i_stem : Speaker => Str ; te, ba : Speaker => Polarity => Str ; + pass_te : Speaker => Polarity => Str ; prep : Str ; obj : Style => Str ; prepositive : Style => Str ; v2vType : Bool} ; AP = {pred : Style => TTense => Polarity => Str ; attr, adv, dropNaEnging, prepositive : Style => Str ; te, ba : Style => Polarity => Str ; needSubject : Bool} ; @@ -42,13 +44,12 @@ flags coding = utf8 ; -- changePolar : Bool ; meaning : Speaker ; anim : Animateness} ; CN = Noun ** {object : Style => Str ; prepositive : Style => Str ; hasAttr : Bool} ; Pron = Pronoun ; -- {s : Style => Str ; Pron1Sg : Bool ; anim : Animateness} ; - Det = Determiner ; -- {quant : Style => Str ; num : Str ; postpositive : Str ; - -- n : Number ; inclCard : Bool ; sp : Style => Str ; no : Bool ; tenPlus : Bool} ; + Det = Determiner ; Predet = {s : Str ; not : Bool} ; Quant = {s : Style => Str ; sp : Style => Str ; no : Bool} ; - Num = ResJpn.Num ; -- {s : Str ; postpositive : Str ; n : Number ; inclCard : Bool ; - -- tenPlus : Bool} ; - Card = {s : Str ; postpositive : Str ; n : Number ; tenPlus : Bool} ; + Num = ResJpn.Num ; -- {s : Str ; postpositive : Str ; n : Number ; inclCard : Bool ; + -- numType : NumType} ; + Card = {s : Str ; postpositive : Str ; n : Number ; numType : NumType} ; Ord = Adj ; -- {pred : Style => TTense => Polarity => Str ; attr, adv, -- dropNaEnging : Str ; te, ba : Polarity => Str} ; DAP = Det ; diff --git a/src/japanese/ConjunctionJpn.gf b/src/japanese/ConjunctionJpn.gf index af3a3930f..873dca9cd 100644 --- a/src/japanese/ConjunctionJpn.gf +++ b/src/japanese/ConjunctionJpn.gf @@ -146,7 +146,7 @@ concrete ConjunctionJpn of Conjunction = CatJpn ** open ResJpn, Prelude in { Or => conj.null ++ dap.spOr ! st } ; no = dap.no ; - tenPlus = dap.tenPlus + numType = dap.numType } ; BaseS x y = { @@ -426,10 +426,11 @@ concrete ConjunctionJpn of Conjunction = CatJpn ** open ResJpn, Prelude in { => False ; _ => True } ; - tenPlus = case of { - => False ; - _ => True - } + numType = case of { + => Small ; + => NoCard ; + _ => TenPlus + } } ; ConsDAP x xs = { @@ -442,20 +443,17 @@ concrete ConjunctionJpn of Conjunction = CatJpn ** open ResJpn, Prelude in { => Sg ; _ => Pl } ; - inclCard = case of { - => False ; - _ => True - } ; spAnd = \\st => x.sp ! st ++ "と" ++ xs.spAnd ! st ; spOr = \\st => x.sp ! st ++ "か" ++ xs.spOr ! st ; no = case of { => False ; _ => True } ; - tenPlus = case of { - => False ; - _ => True - } + numType = case of { + => NoCard ; + => Small ; + _ => TenPlus + } } ; lincat @@ -487,6 +485,6 @@ concrete ConjunctionJpn of Conjunction = CatJpn ** open ResJpn, Prelude in { hasAttr : Bool ; counterTsu : Bool} ; [DAP] = {quantAnd, quantOr : Style => Str ; numAnd, numOr : Str ; - postpositive : Str ; n : Number ; inclCard : Bool ; - spAnd, spOr : Style => Str ; no : Bool ; tenPlus : Bool} ; + postpositive : Str ; n : Number ; + spAnd, spOr : Style => Str ; no : Bool ; numType : NumType} ; } diff --git a/src/japanese/ConstructionJpn.gf b/src/japanese/ConstructionJpn.gf index d63096aab..aebff529f 100644 --- a/src/japanese/ConstructionJpn.gf +++ b/src/japanese/ConstructionJpn.gf @@ -1,5 +1,5 @@ concrete ConstructionJpn of Construction = CatJpn ** - open SyntaxJpn, ParadigmsJpn, (R=ResJpn), (L = LexiconJpn), SymbolicJpn in { + open SyntaxJpn, ParadigmsJpn, (R=ResJpn), (L = LexiconJpn), SymbolicJpn, Prelude in { lin hungry_VP = mkVP (mkV "お腹が空いている" R.Gr1) ; @@ -8,6 +8,28 @@ lin scared_VP = mkVP (mkA "怖い") ; ill_VP = mkVP (mkA "病気の") ; ready_VP = mkVP L.ready_A ; + has_age_VP card = mkVP (mkNP (mkN (card.s ++ "歳"))) ; + + cup_of_CN np = lin CN (mkN "カップ") ** { + object = \\st => np.prepositive ! st ++ np.s ! st ++ "の" ; + prepositive = \\st => [] ; + hasAttr = False + } ; + + n_units_of_NP card unit np = np ** { + s = \\st => card.s ++ unit.s ! R.Sg ! st ++ "の" ++ np.s ! st + } ; + + n_units_AP card unit adj = { + pred = \\st,t,p => card.s ++ unit.s ! R.Sg ! st ++ adj.pred ! st ! t ! p ; + attr = \\st => card.s ++ unit.s ! R.Sg ! st ++ adj.attr ; + te = \\st,p => card.s ++ unit.s ! R.Sg ! st ++ adj.te ! p ; + ba = \\st,p => card.s ++ unit.s ! R.Sg ! st ++ adj.ba ! p ; + adv = \\st => card.s ++ unit.s ! R.Sg ! st ++ adj.adv ! R.Pos ; + dropNaEnging = \\st => card.s ++ unit.s ! R.Sg ! st ++ adj.dropNaEnging ; + prepositive = \\st => [] ; + needSubject = True + } ; lincat diff --git a/src/japanese/ExtraJpn.gf b/src/japanese/ExtraJpn.gf index 7076f6b84..c5ea9b4ef 100644 --- a/src/japanese/ExtraJpn.gf +++ b/src/japanese/ExtraJpn.gf @@ -72,6 +72,7 @@ flags coding = utf8 ; a_stem = \\a,st => "では" ; i_stem = \\a,st => "になり" ; -- "become" - for wishes obj = \\st => cn.s ! Sg ! st ; + comparison = \\st => cn.s ! Sg ! st ; prepositive = cn.prepositive ; needSubject = True } ; diff --git a/src/japanese/GrammarJpn.gf b/src/japanese/GrammarJpn.gf index 39b5a7cb7..458d65f0b 100644 --- a/src/japanese/GrammarJpn.gf +++ b/src/japanese/GrammarJpn.gf @@ -12,5 +12,6 @@ concrete GrammarJpn of Grammar = TextJpn, StructuralJpn, IdiomJpn, - TenseJpn + TenseJpn, + NamesJpn ; diff --git a/src/japanese/NamesJpn.gf b/src/japanese/NamesJpn.gf new file mode 100644 index 000000000..d7b76b61c --- /dev/null +++ b/src/japanese/NamesJpn.gf @@ -0,0 +1,34 @@ +concrete NamesJpn of Names = CatJpn ** open ResJpn, Prelude in { + +lin + GivenName name = name ** { + prepositive = \\st => [] ; + needPart = True ; changePolar = False ; + meaning = SomeoneElse + } ; + + MaleSurname, FemaleSurname, PlSurname = \name -> name ** { + prepositive = \\st => [] ; + needPart = True ; changePolar = False ; + meaning = SomeoneElse + } ; + + FullName gn sn = { + s = \\st => sn.s ! st ++ gn.s ! st ; + prepositive = \\st => [] ; + needPart = True ; changePolar = False ; + meaning = SomeoneElse ; anim = Anim + } ; + + UseLN, PlainLN = \name -> name ** { + prepositive = \\st => [] ; + needPart = True ; changePolar = False ; + meaning = SomeoneElse + } ; + + InLN name = {s = \\st => name.s ! st ++ "で" ; prepositive = False} ; + + AdjLN ap name = name ** { + s = \\st => ap.attr ! st ++ name.s ! st + } ; +} diff --git a/src/japanese/NounJpn.gf b/src/japanese/NounJpn.gf index be22c7111..5be4ff013 100644 --- a/src/japanese/NounJpn.gf +++ b/src/japanese/NounJpn.gf @@ -5,22 +5,23 @@ flags coding = utf8 ; lin DetCN det cn = { - s = \\st => case det.inclCard of { - True => case cn.counterReplace of { - True => case cn.hasAttr of { - True => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.counter ++ det.postpositive - ++ "の" ++ cn.s ! det.n ! st ; - False => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.counter ++ det.postpositive - } ; - False => case of { - => cn.object ! st ++ det.quant ! st ++ det.num ++ "個" ++ det.postpositive - ++ "の" ++ cn.s ! det.n ! st ; - _ => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.counter ++ det.postpositive - ++ "の" ++ cn.s ! det.n ! st - } - } ; - False => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.s ! det.n ! st - } ; + s = \\st => + case det.numType of { + NoCard => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.s ! det.n ! st ; + _ => case cn.counterReplace of { + True => case cn.hasAttr of { + True => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.counter ++ det.postpositive + ++ "の" ++ cn.s ! det.n ! st ; + False => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.counter ++ det.postpositive + } ; + False => case of { + => cn.object ! st ++ det.quant ! st ++ det.num ++ "個" ++ det.postpositive + ++ "の" ++ cn.s ! det.n ! st ; + _ => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.counter ++ det.postpositive + ++ "の" ++ cn.s ! det.n ! st + } + } + } ; prepositive = cn.prepositive ; needPart = True ; changePolar = case det.no of { @@ -98,16 +99,14 @@ flags coding = utf8 ; postpositive = num.postpositive ; num = num.s ; n = num.n ; - inclCard = num.inclCard ; - sp = \\st => case num.inclCard of { - True => case num.tenPlus of { - False => quant.s ! st ++ num.s ++ "つ" ++ num.postpositive ; - True => quant.s ! st ++ num.s ++ num.postpositive - } ; - False => quant.sp ! st ++ num.s - } ; + sp = \\st => + case num.numType of { + NoCard => quant.s ! st ++ num.s ; + Small => quant.s ! st ++ num.s ++ "つ" ++ num.postpositive ; + TenPlus => quant.s ! st ++ num.s ++ num.postpositive + } ; no = quant.no ; - tenPlus = num.tenPlus + numType = num.numType } ; DetQuantOrd quant num ord = { @@ -115,41 +114,67 @@ flags coding = utf8 ; postpositive = num.postpositive ; num = num.s ; n = num.n ; - inclCard = num.inclCard ; - sp = \\st => case num.inclCard of { - True => case num.tenPlus of { - False => quant.s ! st ++ ord.attr ++ num.s ++ "つ" ++ num.postpositive ; - True => quant.s ! st ++ ord.attr ++ num.s ++ num.postpositive - } ; - False => quant.s ! st ++ ord.attr ++ num.s - } ; + sp = \\st => + case num.numType of { + NoCard => quant.s ! st ++ ord.attr ++ num.s ; + Small => quant.s ! st ++ ord.attr ++ num.s ++ "つ" ++ num.postpositive ; + TenPlus => quant.s ! st ++ ord.attr ++ num.s ++ num.postpositive + } ; no = quant.no ; - tenPlus = num.tenPlus + numType = num.numType } ; NumSg = mkNum "" Sg ; NumPl = mkNum "" Pl ; - NumCard card = card ** {inclCard = True} ; + NumCard card = card ; - NumDigits num = num ** {postpositive = []} ; - NumDecimal num = num ** {postpositive = []} ; + NumDigits num = num ** { + postpositive = [] ; + numType=case num.tenPlus of { + False => Small ; + True => TenPlus + } + } ; - NumNumeral num = num ** {postpositive = []} ; + NumDecimal num = num ** { + postpositive = [] ; + numType=case num.tenPlus of { + False => Small ; + True => TenPlus + } + } ; + + QuantityNP decimal unit = { + s = \\st => decimal.s ++ unit.s ; + prepositive = \\st => [] ; + needPart = True ; + changePolar = False ; + meaning = SomeoneElse ; + anim = Inanim + } ; + + NumNumeral num = num ** { + postpositive = []; + numType=case num.tenPlus of { + False => Small ; + True => TenPlus + } + } ; AdNum adn card = case adn.postposition of { True => { s = card.s ; postpositive = adn.s ; n = card.n ; - tenPlus = card.tenPlus + numType = card.numType } ; False => { s = adn.s ++ card.s ; postpositive = [] ; n = card.n ; - tenPlus = card.tenPlus + numType = card.numType } } ; @@ -203,7 +228,6 @@ flags coding = utf8 ; ComplN3 n3 np = n3 ** { object = \\st => np.s ! st ++ n3.prep1 ; - prepositive = np.prepositive ; prep = n3.prep2 ; } ; @@ -273,10 +297,9 @@ flags coding = utf8 ; num = dap.num ; postpositive = dap.postpositive ; n = dap.n ; - inclCard = dap.inclCard ; sp = \\st => dap.sp ! st ++ ap.prepositive ! st ++ ap.attr ! st ; no = dap.no ; - tenPlus = dap.tenPlus + numType = dap.numType } ; DetDAP det = det ; diff --git a/src/japanese/NumeralJpn.gf b/src/japanese/NumeralJpn.gf index a0a8262ab..86188a6e6 100644 --- a/src/japanese/NumeralJpn.gf +++ b/src/japanese/NumeralJpn.gf @@ -1,227 +1,238 @@ -concrete NumeralJpn of Numeral = CatJpn [Numeral,Digits,Decimal] ** open ResJpn, ParadigmsJpn, Prelude in { - -flags coding = utf8 ; - - lincat - Digit = {s : Str ; n : Number} ; - Sub10 = {s : Str ; n : Number ; is1 : Bool ; null : Str} ; - Sub100 = {s : Str ; n : Number ; numType : NumeralType ; digit1 : Str ; digit2 : Str ; - tenPlus : Bool ; is1 : Bool} ; - Sub1000 = {s_init : Str ; s_mid : Str ; n : Number ; numType : NumeralType ; - man : Str ; sen : Str ; tenPlus : Bool ; is1 : Bool ; null : Str} ; - Sub1000000 = {s : Str ; n : Number ; tenPlus : Bool} ; - - lin - num dig = dig ; - - n2 = {s = "二" ; n = Pl} ; -- "ni" - n3 = {s = "三" ; n = Pl} ; -- "san" - n4 = {s = "四" ; n = Pl} ; -- "yon" - n5 = {s = "五" ; n = Pl} ; -- "go" - n6 = {s = "六" ; n = Pl} ; -- "roku" - n7 = {s = "七" ; n = Pl} ; -- "shichi" - n8 = {s = "八" ; n = Pl} ; -- "hachi" - n9 = {s = "九" ; n = Pl} ; -- "kyuu" - - pot01 = {s = "一" ; n = Sg ; is1 = True ; null = ""} ; - - pot0 d = d ** {is1 = False ; null = ""} ; - - pot110 = { - s = "十" ; -- "juu" - n = Pl ; - numType = EndZero ; - digit1 = "一" ; - digit2 = "0" ; - tenPlus = True ; - is1 = False - } ; - - pot111 = { - s = "十一" ; - n = Pl ; - numType = EndNotZero ; - digit1 = "一" ; - digit2 = "一" ; - tenPlus = True ; - is1 = False - } ; - - pot1to19 d = { - s = "十" ++ d.s ; - n = Pl ; - numType = EndNotZero ; - digit1 = "一" ; - digit2 = d.s ; - tenPlus = True ; - is1 = False - } ; - - pot0as1 d = { - s = d.s ; - n = Pl ; - numType = SingleDigit ; - digit1 = [] ; - digit2 = d.s ; - tenPlus = False ; - is1 = d.is1 - } ; - - pot1 d = { - s = d.s ++ "十" ; - n = Pl ; - numType = EndZero ; - digit1 = d.s ; - digit2 = "0" ; - tenPlus = True ; - is1 = False - } ; - - pot1plus d n = { - s = d.s ++ "十" ++ n.s ; - n = Pl ; - numType = EndNotZero ; - digit1 = d.s ; - digit2 = n.s ; - tenPlus = True ; - is1 = False - } ; - - pot1as2 d = { - s_init = d.s ; - s_mid = d.s ; - n = d.n ; - numType = d.numType ; - man = d.digit1 ; - sen = d.digit2 ; - tenPlus = d.tenPlus ; - is1 = d.is1 ; - null = "" - } ; - - pot2 d = { - s_init = case d.is1 of { - True => d.null ++ "百" ; -- "hyaku" - False => d.s ++ "百" - } ; - s_mid = d.s ++ "百" ; - n = Pl ; - numType = EndZero ; - man = case d.is1 of { - True => d.null ++ "十" ; - False => d.s ++ "十" - } ; - sen = [] ; - tenPlus = True ; - is1 = False ; - null = "" - } ; - - pot2plus d n = { - s_init = case d.is1 of { - True => d.null ++ "百" ++ n.s ; - False => d.s ++ "百" ++ n.s - } ; - s_mid = d.s ++ "百" ++ n.s ; - n = Pl ; - numType = case n.numType of { - EndZero => EndZero ; - _ => EndNotZero - } ; - man = case d.is1 of { - True => d.null ++ "十" ++ n.digit1 ; - False => d.s ++ "十" ++ n.digit1 - } ; - sen = n.digit2 ; - tenPlus = True ; - is1 = False ; - null = "" - } ; - - pot2as3 d = { - s = d.s_init ; - n = d.n ; - tenPlus = d.tenPlus - } ; - - pot3 d = { - s = case d.numType of { - EndZero => d.man ++ "万" ; -- "man" - EndNotZero => d.man ++ "万" ++ d.sen ++ "千" ; -- "sen" - SingleDigit => case d.is1 of { - True => d.null ++ "千" ; - False => d.s_init ++ "千" - } - } ; - n = Pl; - tenPlus = True - } ; - - pot3plus d n = { - s = case d.numType of { - EndZero => d.man ++ "万" ++ n.s_mid ; - EndNotZero => d.man ++ "万" ++ d.sen ++ "千" ++ n.s_mid ; - SingleDigit => case d.is1 of { - True => d.null ++ "千" ++ n.s_mid ; - False => d.s_init ++ "千" ++ n.s_mid - } - } ; - n = Pl; - tenPlus = True - } ; - - lincat - Dig = {s : Str ; n : Number ; is0 : Bool} ; - - lin - IDig d = { - s = d.s ; - n = d.n ; - tenPlus = False ; - tail = T1 - } ; - - IIDig d n = { - s = d.s ++ commaIf n.tail ++ n.s ; - n = Pl ; - tenPlus = case of { - <_, True> => True ; - => False ; - _ => True - } ; - tail = inc n.tail - } ; - - D_0 = {s = "0" ; n = Sg ; is0 = True} ; - D_1 = {s = "1" ; n = Sg ; is0 = False} ; - D_2 = {s = "2" ; n = Pl ; is0 = False} ; - D_3 = {s = "3" ; n = Pl ; is0 = False} ; - D_4 = {s = "4" ; n = Pl ; is0 = False} ; - D_5 = {s = "5" ; n = Pl ; is0 = False} ; - D_6 = {s = "6" ; n = Pl ; is0 = False} ; - D_7 = {s = "7" ; n = Pl ; is0 = False} ; - D_8 = {s = "8" ; n = Pl ; is0 = False} ; - D_9 = {s = "9" ; n = Pl ; is0 = False} ; - - PosDecimal d = d ** {hasDot=False} ; - NegDecimal d = { - s = "-" ++ BIND ++ d.s ; - n = Pl ; - tenPlus = d.tenPlus ; - hasDot=False - } ; - IFrac d i = { - s = d.s ++ - if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ - i.s; - n = Pl ; - tenPlus = d.tenPlus ; - hasDot=True - } ; - - oper - commaIf : DTail -> Str = \t -> case t of { - T3 => "," ; - _ => [] - } ; -} +concrete NumeralJpn of Numeral = CatJpn [Numeral,Digits,Decimal] ** open ResJpn, ParadigmsJpn, Prelude in { + +flags coding = utf8 ; + + lincat + Digit = {s : Str} ; + Sub10 = {s : Str ; n : Number ; null : Str} ; + Sub100 = {s : Str ; n : Number ; numType : NumeralType ; digit1 : Str ; digit2 : Str} ; + Sub1000 = {s_init : Str ; s_mid : Str ; n : Number ; numType : NumeralType ; + man : Str ; sen : Str ; null : Str} ; + Sub1000000 = {s : Str ; n : Number ; tenPlus : Bool} ; + Sub1000000000 = {s : Str ; n : Number ; tenPlus : Bool} ; + Sub1000000000000 = {s : Str ; n : Number ; tenPlus : Bool} ; + + lin + num dig = dig ; + + n2 = {s = "二"} ; -- "ni" + n3 = {s = "三"} ; -- "san" + n4 = {s = "四"} ; -- "yon" + n5 = {s = "五"} ; -- "go" + n6 = {s = "六"} ; -- "roku" + n7 = {s = "七"} ; -- "shichi" + n8 = {s = "八"} ; -- "hachi" + n9 = {s = "九"} ; -- "kyuu" + + pot01 = {s = "一" ; n = Sg ; null = ""} ; + + pot0 d = d ** {n = Pl; null = ""} ; + + pot110 = { + s = "十" ; -- "juu" + n = Pl ; + numType = EndZero ; + digit1 = "一" ; + digit2 = "0" + } ; + + pot111 = { + s = "十一" ; + n = Pl ; + numType = EndNotZero ; + digit1 = "一" ; + digit2 = "一" + } ; + + pot1to19 d = { + s = "十" ++ d.s ; + n = Pl ; + numType = EndNotZero ; + digit1 = "一" ; + digit2 = d.s + } ; + + pot0as1 d = { + s = d.s ; + n = Pl ; + numType = SingleDigit ; + digit1 = [] ; + digit2 = d.s + } ; + + pot1 d = { + s = d.s ++ "十" ; + n = Pl ; + numType = EndZero ; + digit1 = d.s ; + digit2 = "0" + } ; + + pot1plus d n = { + s = d.s ++ "十" ++ n.s ; + n = Pl ; + numType = EndNotZero ; + digit1 = d.s ; + digit2 = n.s + } ; + + pot1as2 d = { + s_init = d.s ; + s_mid = d.s ; + n = d.n ; + numType = d.numType ; + man = d.digit1 ; + sen = d.digit2 ; + null = "" + } ; + + pot2 d = { + s_init = case d.n of { + Sg => d.null ++ "百" ; -- "hyaku" + Pl => d.s ++ "百" + } ; + s_mid = d.s ++ "百" ; + n = Pl ; + numType = EndZero ; + man = case d.n of { + Sg => d.null ++ "十" ; + Pl => d.s ++ "十" + } ; + sen = [] ; + null = "" + } ; + + pot21 = { + s_init = "百" ; s_mid = "百" ; n = Pl ; numType = EndZero ; + man = "十" ; sen = [] ; null = "" + } ; + + pot2plus d n = { + s_init = case d.n of { + Sg => d.null ++ "百" ++ n.s ; + Pl => d.s ++ "百" ++ n.s + } ; + s_mid = d.s ++ "百" ++ n.s ; + n = Pl ; + numType = case n.numType of { + EndZero => EndZero ; + _ => EndNotZero + } ; + man = case d.n of { + Sg => d.null ++ "十" ++ n.digit1 ; + Pl => d.s ++ "十" ++ n.digit1 + } ; + sen = n.digit2 ; + null = "" + } ; + + pot2as3 d = { + s = d.s_init ; + n = d.n ; + tenPlus = case d.numType of { + SingleDigit => False ; + _ => True + } + } ; + + pot3 d = { + s = case d.numType of { + EndZero => d.man ++ "万" ; -- "man" + EndNotZero => d.man ++ "万" ++ d.sen ++ "千" ; -- "sen" + SingleDigit => case d.n of { + Sg => d.null ++ "千" ; + Pl => d.s_init ++ "千" + } + } ; + n = Pl; + tenPlus = True + } ; + + pot3plus d n = { + s = case d.numType of { + EndZero => d.man ++ "万" ++ n.s_mid ; + EndNotZero => d.man ++ "万" ++ d.sen ++ "千" ++ n.s_mid ; + SingleDigit => case d.n of { + Sg => d.null ++ "千" ++ n.s_mid ; + Pl => d.s_init ++ "千" ++ n.s_mid + } + } ; + n = Pl; + tenPlus = True + } ; + + pot31 = {s = "千" ; n = Pl ; tenPlus = True} ; + + pot3as4 n = n ; + pot3decimal n = {s = n.s ++ "千" ; n = Pl ; tenPlus = True} ; + + pot41 = {s = "百万" ; n = Pl ; tenPlus = True} ; + pot4 n = {s = n.s_init ++ "百万" ; n = Pl ; tenPlus = True} ; + pot4plus n m = { + s = n.s_init ++ "百万" ++ m.s ; n = Pl ; tenPlus = True + } ; + pot4as5 n = n ; + pot4decimal n = {s = n.s ++ "百万" ; n = Pl ; tenPlus = True} ; + + pot51 = {s = "十億" ; n = Pl ; tenPlus = True} ; + pot5 n = {s = n.s_init ++ "十億" ; n = Pl ; tenPlus = True} ; + pot5plus n m = { + s = n.s_init ++ "十億" ++ m.s ; n = Pl ; tenPlus = True + } ; + pot5decimal n = {s = n.s ++ "十億" ; n = Pl ; tenPlus = True} ; + + lincat + Dig = {s : Str ; n : Number ; is0 : Bool} ; + + lin + IDig d = { + s = d.s ; + n = d.n ; + tenPlus = False ; + tail = T1 + } ; + + IIDig d n = { + s = d.s ++ commaIf n.tail ++ n.s ; + n = Pl ; + tenPlus = case of { + <_, True> => True ; + => False ; + _ => True + } ; + tail = inc n.tail + } ; + + D_0 = {s = "0" ; n = Sg ; is0 = True} ; + D_1 = {s = "1" ; n = Sg ; is0 = False} ; + D_2 = {s = "2" ; n = Pl ; is0 = False} ; + D_3 = {s = "3" ; n = Pl ; is0 = False} ; + D_4 = {s = "4" ; n = Pl ; is0 = False} ; + D_5 = {s = "5" ; n = Pl ; is0 = False} ; + D_6 = {s = "6" ; n = Pl ; is0 = False} ; + D_7 = {s = "7" ; n = Pl ; is0 = False} ; + D_8 = {s = "8" ; n = Pl ; is0 = False} ; + D_9 = {s = "9" ; n = Pl ; is0 = False} ; + + PosDecimal d = d ** {hasDot=False} ; + NegDecimal d = { + s = "-" ++ BIND ++ d.s ; + n = Pl ; + tenPlus = d.tenPlus ; + hasDot=False + } ; + IFrac d i = { + s = d.s ++ + if_then_Str d.hasDot BIND (BIND++"."++BIND) ++ + i.s; + n = Pl ; + tenPlus = d.tenPlus ; + hasDot=True + } ; + + oper + commaIf : DTail -> Str = \t -> case t of { + T3 => "," ; + _ => [] + } ; +} diff --git a/src/japanese/ParadigmsJpn.gf b/src/japanese/ParadigmsJpn.gf index cbae3384a..24fd7af55 100644 --- a/src/japanese/ParadigmsJpn.gf +++ b/src/japanese/ParadigmsJpn.gf @@ -17,7 +17,7 @@ oper mkN = overload { mkN : (man : Str) -> N -- Inanimate noun. Counter is つ and doesn't replace the noun. - = \n -> lin N (regNoun n Inanim "つ" False True) ; ---- AR 15/11/2014 + = \n -> lin N (regNoun n Inanim "つ" False True) ; mkN : (man : Str) -> (anim : Animacy) -> N -- Animacy given as argument. Counter is つ and doesn't replace the noun. = \n,a -> lin N (regNoun n a "つ" False True) ; mkN : (kane,okane : Str) -> (anim : Animacy) -> N -- Style variation (plain, respectful) and animacy given. Counter is つ and doesn't replace the noun. @@ -75,58 +75,93 @@ oper = \pred,attr,pr -> lin A2 (VerbalA pred attr) ** {prep = pr} } ; + mkAdV : Str -> AdV = \s -> lin AdV {s = s} ; + + mkAdA : Str -> AdA = \s -> lin AdA {s = s} ; + + mkAdN : Str -> AdN = \s -> lin AdN {s = s; postposition = False} ; + mkV = overload { mkV : (yomu : Str) -> V -- Default: group 1 verb - = \yomu -> lin V (mkVerb yomu Gr1) ; ---- AR 15/11/2014 + = \yomu -> lin V (mkVerb (cleanVerb yomu) (guessVerbGroup (cleanVerb yomu))) ; mkV : (yomu : Str) -> (group : VerbGroup) -> V - = \yomu,gr -> lin V (mkVerb yomu gr) ; -- Base form and verb group given + = \yomu,gr -> lin V (mkVerb (cleanVerb yomu) gr) ; -- Base form and verb group given } ; mkV2 = overload { mkV2 : (yomu : Str) -> V2 -- Group 1 verb, を as object marker - = \yomu -> lin V2 (mkVerb2 yomu "を" Gr1) ; ---- AR 15/11/2014 + = \yomu -> lin V2 (mkVerb2 (cleanVerb yomu) "を" (guessVerbGroup (cleanVerb yomu))) ; mkV2 : (yomu, prep : Str) -> (group : VerbGroup) -> V2 -- Base form, object marker and verb group given - = \yomu,p,gr -> lin V2 (mkVerb2 yomu p gr) ; + = \yomu,p,gr -> lin V2 (mkVerb2 (cleanVerb yomu) p gr) ; } ; mkV3 = overload { mkV3 : (yomu : Str) -> V3 -- Group 1 verb, に and を as object markers - = \yomu -> lin V3 (mkVerb3 yomu "に" "を" Gr1) ; + = \yomu -> lin V3 (mkVerb3 (cleanVerb yomu) "に" "を" (guessVerbGroup (cleanVerb yomu))) ; mkV3 : (uru, p1, p2 : Str) -> (group : VerbGroup) -> V3 -- Base form, object markers and verb group given - = \uru,p1,p2,gr -> lin V3 (mkVerb3 uru p1 p2 gr) ; + = \uru,p1,p2,gr -> lin V3 (mkVerb3 (cleanVerb uru) p1 p2 gr) ; } ; mkVS : (yomu : Str) -> VS - = \yomu -> lin VS (mkVerb2 yomu "ことを" Gr1) ; + = \yomu -> lin VS (mkVerb2 (cleanVerb yomu) "ことを" (guessVerbGroup (cleanVerb yomu))) ; mkVV : (yomu : Str) -> VV - = \yomu -> lin VV (mkVerbV yomu Gr1) ; + = \yomu -> lin VV (mkVerbV (cleanVerb yomu) (guessVerbGroup (cleanVerb yomu))) ; mkV2V : (yomu : Str) -> V2V - = \yomu -> lin V2V (mkVerb yomu Gr1) ; + = \yomu -> lin V2V (mkVerb (cleanVerb yomu) (guessVerbGroup (cleanVerb yomu))) ; mkV2S : (yomu : Str) -> V2S - = \yomu -> lin V2S (mkVerb yomu Gr1) ; + = \yomu -> lin V2S (mkVerb (cleanVerb yomu) (guessVerbGroup (cleanVerb yomu))) ; mkVQ : (yomu : Str) -> VQ - = \yomu -> lin VQ (mkVerb2 yomu "を" Gr1) ; + = \yomu -> lin VQ (mkVerb2 (cleanVerb yomu) "を" (guessVerbGroup (cleanVerb yomu))) ; mkVA : (yomu : Str) -> VA - = \yomu -> lin VA (mkVerb yomu Gr1) ; + = \yomu -> lin VA (mkVerb (cleanVerb yomu) (guessVerbGroup (cleanVerb yomu))) ; mkV2A : (yomu : Str) -> V2A - = \yomu -> lin V2A (mkVerb yomu Gr1) ; + = \yomu -> lin V2A (mkVerb (cleanVerb yomu) (guessVerbGroup (cleanVerb yomu))) ; mkAdv : Str -> Adv - = \s -> lin Adv (ResJpn.mkAdv s) ; ---- AR 15/11/2014 + = \s -> lin Adv (ResJpn.mkAdv (cleanLemma s)) ; mkPrep : Str -> Prep - = \s -> lin Prep (ResJpn.mkPrep s) ; ---- AR 15/11/2014 + = \s -> lin Prep (ResJpn.mkPrep (cleanLemma s)) ; mkDet : Str -> Det = \d -> lin Det (ResJpn.mkDet d d ResJpn.Sg) ; mkConj : Str -> Conj = \c -> lin Conj (ResJpn.mkConj c ResJpn.And) ; + guessVerbGroup : Str -> VerbGroup = \v -> case v of { + stem + "する" => Suru ; + stem + "来る" => Kuru ; + stem + "える" => Gr2 ; stem + "ける" => Gr2 ; stem + "げる" => Gr2 ; + stem + "せる" => Gr2 ; stem + "ぜる" => Gr2 ; stem + "てる" => Gr2 ; + stem + "でる" => Gr2 ; stem + "ねる" => Gr2 ; stem + "べる" => Gr2 ; + stem + "める" => Gr2 ; stem + "れる" => Gr2 ; stem + "いる" => Gr2 ; + stem + "きる" => Gr2 ; stem + "ぎる" => Gr2 ; stem + "じる" => Gr2 ; + stem + "ちる" => Gr2 ; stem + "にる" => Gr2 ; stem + "びる" => Gr2 ; + stem + "みる" => Gr2 ; stem + "りる" => Gr2 ; + stem + ("見る"|"得る"|"着る"|"出る"|"寝る"|"居る"|"似る"|"経る") => Gr2 ; + stem + "ずる" => Gr2 ; + _ => Gr1 + } ; + + cleanVerb : Str -> Str = \v -> case v of { + stem + "+する" => stem + "する" ; + stem + "ずる" => stem + "じる" ; + _ => cleanLemma v + } ; + + cleanLemma : Str -> Str = \s -> case s of { + "..." + rest => rest ; + "…" + rest => rest ; + "〜" + rest => rest ; + "~" + rest => rest ; + _ => s + } ; + mkInterj : Str -> Interj = \s -> lin Interj (ss s) ; diff --git a/src/japanese/QuestionJpn.gf b/src/japanese/QuestionJpn.gf index 0073b0c49..a6d4f87f6 100644 --- a/src/japanese/QuestionJpn.gf +++ b/src/japanese/QuestionJpn.gf @@ -105,9 +105,9 @@ flags coding = utf8 ; } ; IdetIP idet = { - s_subj, s_obj = \\st => case idet.inclCard of { - True => idet.s ++ "つ" ; - False => idet.s + s_subj, s_obj = \\st => case idet.numType of { + NoCard => idet.s ; + _ => idet.s ++ "つ" } ; anim = Inanim ; -- can be Anim, depending on the context how8many = False -- "how many" alone behaves as other IPs @@ -124,7 +124,7 @@ flags coding = utf8 ; s = iquant.s ++ num.s ; n = num.n ; how8many = False ; - inclCard = num.inclCard + numType = num.numType } ; PrepIP prep ip = {s = \\st => ip.s_obj ! st ++ prep.s ; particle = "" ; wh8re = False} ; diff --git a/src/japanese/ResJpn.gf b/src/japanese/ResJpn.gf index b7f206f3b..0aa59ac7a 100644 --- a/src/japanese/ResJpn.gf +++ b/src/japanese/ResJpn.gf @@ -18,6 +18,7 @@ param SubjType = That | If | OtherSubj ; VocType = VocPres | Please | VocAbs ; UttType = Imper | ImpPolite | NoImp ; + NumType = NoCard | Small | TenPlus ; oper @@ -39,9 +40,8 @@ oper Adverb : Type = {s : Style => Str ; prepositive : Bool} ; Pronoun : Type = {s : Style => Str ; Pron1Sg : Bool ; anim : Animateness} ; Determiner : Type = {quant : Style => Str ; postpositive : Str ; num : Str ; n : Number ; - inclCard : Bool ; sp : Style => Str ; no : Bool ; tenPlus : Bool} ; - Num : Type = {s : Str ; postpositive : Str ; n : Number ; inclCard : Bool ; - tenPlus : Bool} ; + sp : Style => Str ; no : Bool ; numType : NumType} ; + Num : Type = {s : Str ; postpositive : Str ; n : Number ; numType : NumType} ; Preposition : Type = {s : Str ; null : Str} ; Verb : Type = {s : Style => TTense => Polarity => Str ; a_stem, i_stem : Str ; te, ba : Polarity => Str ; needSubject : Bool} ; @@ -83,7 +83,26 @@ oper regAdj : Str -> Adj = \a -> case a of { chiisa + "い" => i_mkAdj a ; - _ => na_mkAdj a -- ooki + ("な"|"の") => na_mkAdj a + stem + "された" => VerbalA (stem + "されている") a ; + stem + "した" => VerbalA (stem + "している") a ; + stem + "った" => VerbalA (stem + "っている") a ; + stem + "いた" => VerbalA (stem + "いている") a ; + stem + "いだ" => VerbalA (stem + "いでいる") a ; + stem + "んだ" => VerbalA (stem + "んでいる") a ; + stem + "れた" => VerbalA (stem + "れている") a ; + stem + "けた" => VerbalA (stem + "けている") a ; + stem + "げた" => VerbalA (stem + "げている") a ; + stem + "せた" => VerbalA (stem + "せている") a ; + stem + "ぜた" => VerbalA (stem + "ぜている") a ; + stem + "てた" => VerbalA (stem + "てている") a ; + stem + "でた" => VerbalA (stem + "でている") a ; + stem + "ねた" => VerbalA (stem + "ねている") a ; + stem + "べた" => VerbalA (stem + "べている") a ; + stem + "めた" => VerbalA (stem + "めている") a ; + stem + "た" => VerbalA (stem + "ている") a ; + stem + "できる" => VerbalA a a ; + _ + ("いる"|"ある"|"する"|"来る") => VerbalA a a ; + _ => na_mkAdj a } ; i_mkAdj : Str -> Adj = \chiisai -> @@ -130,20 +149,23 @@ oper na_mkAdj : Str -> Adj = \ookina -> let - ooki = init ookina + forms = case ookina of { + stem + ("な"|"の") => {root = stem ; attr = ookina} ; + _ => {root = ookina ; attr = ookina + "な"} + } in { - pred = \\st,t,p => ooki ++ mkCopula.s ! st ! t ! p ; - attr = ookina ; + pred = \\st,t,p => forms.root ++ mkCopula.s ! st ! t ! p ; + attr = forms.attr ; te = table { - Pos => ooki + "で" ; - Neg => ooki + "ではなくて" + Pos => forms.root + "で" ; + Neg => forms.root + "ではなくて" } ; - ba = \\p => ooki ++ mkCopula.ba ! p ; + ba = \\p => forms.root ++ mkCopula.ba ! p ; adv = table { - Pos => ooki + "に" ; - Neg => ooki + "ではなく" + Pos => forms.root + "に" ; + Neg => forms.root + "ではなく" } ; - dropNaEnging = ooki + dropNaEnging = forms.root } ; -- Added by IL 2017-07. Used in NounJpn and SymbolJpn. @@ -357,8 +379,7 @@ oper Suru => Predef.tk 2 yomu + "されなければ" ; Kuru => "来られなければ" } - } ; - needSubject = True + } } ; mkVerb3 : Str -> Str -> Str -> VerbGroup -> Verb3 = @@ -581,7 +602,7 @@ oper postpositive = [] ; n = n ; inclCard = False ; - tenPlus = False + numType = Small } ; regPron : Str -> Bool -> Animateness -> Pronoun = \kare,b,a -> { @@ -598,7 +619,7 @@ oper inclCard = False ; sp = \\st => sp ; no = False ; - tenPlus = False + numType = Small } ; stylePron : Str -> Str -> Bool -> Animateness -> Pronoun = \boku,watashi,b,a -> { diff --git a/src/japanese/SentenceJpn.gf b/src/japanese/SentenceJpn.gf index c55a31609..077f32087 100644 --- a/src/japanese/SentenceJpn.gf +++ b/src/japanese/SentenceJpn.gf @@ -177,6 +177,10 @@ flags coding = utf8 ; } } } ; + + AdvImp adv imp = { + s = \\st,p => adv.s ! st ++ imp.s ! st ! p + } ; EmbedS sent = {s = \\part,st => sent.subj ! part ! st ++ sent.pred ! Plain ; isVP = False} ; diff --git a/src/japanese/StructuralJpn.gf b/src/japanese/StructuralJpn.gf index ab6a4f625..bc6f4b695 100644 --- a/src/japanese/StructuralJpn.gf +++ b/src/japanese/StructuralJpn.gf @@ -37,7 +37,7 @@ flags coding = utf8 ; here7to_Adv = R.mkAdv "ここに" ; here7from_Adv = R.mkAdv "ここから" ; how_IAdv = {s = \\st => "どのように" ; particle = "" ; wh8re = False} ; - how8many_IDet = {s = "いくつ" ; n = R.Pl ; how8many = True ; inclCard = False} ; + how8many_IDet = {s = "いくつ" ; n = R.Pl ; how8many = True ; numType = R.NoCard} ; how8much_IAdv = {s = \\st => "いくら" ; particle = "" ; wh8re = False} ; i_Pron = mkPron "私" "私" True R.Anim ; -- "watashi" if_Subj = R.mkSubj "" R.If ; diff --git a/src/japanese/VerbJpn.gf b/src/japanese/VerbJpn.gf index 7dd41f47b..7e9f39670 100644 --- a/src/japanese/VerbJpn.gf +++ b/src/japanese/VerbJpn.gf @@ -95,6 +95,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { SlashV2a v2 = { s = \\sp,st,t,p => v2.s ! st ! t ! p ; + pass = \\sp,st,t,p => v2.pass ! st ! t ! p ; a_stem = \\sp => v2.a_stem ; i_stem = \\sp => v2.i_stem ; ba = \\sp => v2.ba ; @@ -102,11 +103,13 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { obj = \\st => [] ; prepositive = \\st => [] ; te = \\sp => v2.te ; + pass_te = \\sp => v2.pass_te ; v2vType = False } ; Slash2V3 v3 np = { s = \\sp,st,t,p => v3.s ! np.meaning ! st ! t ! p ; + pass = \\sp,st,t,p => v3.s ! np.meaning ! st ! t ! p ; a_stem = \\sp => v3.a_stem ! np.meaning ; i_stem = \\sp => v3.i_stem ! np.meaning ; ba = \\sp,p => v3.ba ! np.meaning ! p ; @@ -114,6 +117,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { obj = \\st => np.s ! st ++ v3.prep1 ; prepositive = np.prepositive ; te = \\sp,p => v3.te ! np.meaning ! p ; + pass_te = \\sp,p => v3.te ! np.meaning ! p ; v2vType = False } ; @@ -122,6 +126,8 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { SlashV2V v2v vp = vp ** { s = \\sp,st,t,p => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++ v2v.s ! st ! t ! p ; + pass = \\sp,st,t,p => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++ "ように" + ++ v2v.s ! st ! t ! p ; a_stem = \\sp => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++ v2v.a_stem ; i_stem = \\sp => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++ @@ -132,11 +138,14 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { obj = \\st => vp.obj ! st ++ vp.prep ; te = \\sp,p => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++ v2v.te ! p ; + pass_te = \\sp,p => vp.verb ! SomeoneElse ! Anim ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++ + v2v.te ! p ; v2vType = True } ; SlashV2S v2s s = { s = \\sp,st,t,p => v2s.s ! st ! t ! p ; + pass = \\sp,st,t,p => v2s.s ! st ! t ! p ; a_stem = \\sp => v2s.a_stem ; i_stem = \\sp => v2s.i_stem ; ba = \\sp => v2s.ba ; @@ -144,11 +153,13 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { obj = \\st => s.subj ! Ga ! st ++ s.pred ! Plain ++ "と" ; prepositive = \\st => [] ; te = \\sp => v2s.te ; + pass_te = \\sp => v2s.te ; v2vType = False } ; SlashV2Q v2q qs = { s = \\sp,st,t,p => v2q.s ! st ! t ! p ; + pass = \\sp,st,t,p => v2q.s ! st ! t ! p ; a_stem = \\sp => v2q.a_stem ; i_stem = \\sp => v2q.i_stem ; ba = \\sp => v2q.ba ; @@ -156,11 +167,13 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { obj = \\st => qs.s_plain_pred ! Ga ! st ; prepositive = \\st => [] ; te = \\sp => v2q.te ; + pass_te = \\sp => v2q.te ; v2vType = True } ; SlashV2A v2a ap = { s = \\sp,st,t,p => v2a.s ! st ! t ! p ; + pass = \\sp,st,t,p => v2a.s ! st ! t ! p ; a_stem = \\sp => v2a.a_stem ; i_stem = \\sp => v2a.i_stem ; ba = \\sp => v2a.ba ; @@ -168,6 +181,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { obj = ap.adv ; prepositive = ap.prepositive ; te = \\sp => v2a.te ; + pass_te = \\sp => v2a.te ; v2vType = True } ; @@ -239,12 +253,15 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { SlashV2VNP v2v np vpslash = { s = \\sp,st,t,p => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++ v2v.s ! st ! t ! p ; + pass = \\sp,st,t,p => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ "ように" + ++ v2v.s ! st ! t ! p ; a_stem = \\sp => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++ v2v.a_stem ; i_stem = \\sp => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++ v2v.i_stem ; ba = \\sp,p => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++ v2v.ba ! p ; prep = vpslash.prep ; obj = \\st => np.s ! st ++ "に" ++ vpslash.obj ! st ; te = \\sp,p => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++ v2v.te ! p ; + pass_te = \\sp,p => vpslash.s ! sp ! Plain ! TPres ! ResJpn.Pos ++ "ように" ++ v2v.te ! p ; prepositive = \\st => np.prepositive ! st ++ vpslash.prepositive ! st ; v2vType = True } ; @@ -318,9 +335,11 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { VPSlashPrep vp prep = { s = \\sp,st,t,p => vp.verb ! sp ! Anim ! st ! t ! p ; + pass = \\sp,st,t,p => vp.verb ! sp ! Anim ! st ! t ! p ; a_stem = \\sp => vp.a_stem ! sp ! Anim ! Plain ; i_stem = \\sp => vp.i_stem ! sp ! Anim ! Plain ; te = \\sp,p => vp.te ! sp ! Anim ! Plain ! p ; + pass_te = \\sp,p => vp.te ! sp ! Anim ! Plain ! p ; ba = \\sp,p => vp.ba ! sp ! Anim ! Plain ! p ; prep = prep.s ; obj = \\st => [] ; @@ -335,6 +354,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { i_stem = \\a,st => ap.adv ! st ++ "なり" ; ba = \\a => ap.ba ; obj = \\st => [] ; + comparison = ap.dropNaEnging ; prepositive = ap.prepositive ; needSubject = ap.needSubject } ; @@ -346,6 +366,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { a_stem = \\a,st => "では" ; i_stem = \\a,st => "になり" ; -- "become" - for wishes obj = \\st => np.s ! st ; + comparison = np.s ; prepositive = np.prepositive ; needSubject = True } ; @@ -364,6 +385,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { True => adv.s ! st ; False => [] } ; + comparison = adv.s ; needSubject = True } ; @@ -374,6 +396,7 @@ concrete VerbJpn of Verb = CatJpn ** open ResJpn, Prelude in { a_stem = \\a,st => "では" ; i_stem = \\a,st => "になり" ; -- "become" - for wishes obj = \\st => cn.s ! Sg ! st ; + comparison = \\st => cn.s ! Sg ! st ; prepositive = cn.prepositive ; needSubject = True } ;