Merge pull request #301 from inariksit/japanese

Japanese
This commit is contained in:
Inari Listenmaa
2020-02-11 15:33:28 +01:00
committed by GitHub
2 changed files with 29 additions and 21 deletions

View File

@@ -10,7 +10,8 @@ flags coding = utf8 ;
True => case cn.hasAttr of { True => case cn.hasAttr of {
True => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.counter ++ det.postpositive True => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.counter ++ det.postpositive
++ "の" ++ cn.s ! det.n ! st ; ++ "の" ++ cn.s ! det.n ! st ;
False => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.counter ++ det.postpositive False => cn.object ! st ++ det.quant ! st ++ det.num ++ cn.counter ++ det.postpositive
++ cn.s ! det.n ! st
} ; } ;
False => case <det.tenPlus, cn.counterTsu> of { False => case <det.tenPlus, cn.counterTsu> of {
<True, True> => cn.object ! st ++ det.quant ! st ++ det.num ++ "個" ++ det.postpositive <True, True> => cn.object ! st ++ det.quant ! st ++ det.num ++ "個" ++ det.postpositive

View File

@@ -5,38 +5,38 @@ flags coding = utf8 ;
oper oper
VerbGroup : Type ; VerbGroup : Type ; -- Parameter for mkV*
gr1 : VerbGroup ; -- Basic form ends in -u, consonant stem. gr1 : VerbGroup ; -- Basic form ends in -u, consonant stem.
gr2 : VerbGroup ; -- Basic form ends in -iru/-eru, vowel stem. gr2 : VerbGroup ; -- Basic form ends in -iru/-eru, vowel stem.
suru : VerbGroup ; -- Irregular: kuru suru : VerbGroup ; -- Irregular: kuru
kuru : VerbGroup ; -- Irregular: suru kuru : VerbGroup ; -- Irregular: suru
Animacy : Type ; -- Parameter for mkN*
animate : Animacy ;
inanimate : Animacy ;
mkN = overload { mkN = overload {
mkN : (man : Str) -> N -- Inanimate noun. Counter is つ and not replaceable. mkN : (man : Str) -> N -- Inanimate noun. Counter is つ and not replaceable.
= \n -> lin N (regNoun n Inanim "つ" False True) ; ---- AR 15/11/2014 = \n -> lin N (regNoun n Inanim "つ" False True) ; ---- AR 15/11/2014
mkN : (man : Str) -> (anim : Animateness) -> N -- Animacy given as argument. Counter is つ and not replaceable. mkN : (man : Str) -> (anim : Animacy) -> N -- Animacy given as argument. Counter is つ and not replaceable.
= \n,a -> lin N (regNoun n a "つ" False True) ; = \n,a -> lin N (regNoun n a "つ" False True) ;
mkN : (kane,okane : Str) -> (anim : Animateness) -> N -- Style variation (plain, respectful) and animacy given. Counter is つ and not replaceable. mkN : (kane,okane : Str) -> (anim : Animacy) -> N -- Style variation (plain, respectful) and animacy given. Counter is つ and not replaceable.
= \kane,okane,a -> lin N (styleNoun kane okane a "つ" False True) ; = \kane,okane,a -> lin N (styleNoun kane okane a "つ" False True) ;
mkN : (man : Str) -> (anim : Animateness) -> (counter : Str) -> (counterReplace : Bool) -> N -- No style variation. Arguments are animacy, counter and whether counter is replaceable. mkN : (man : Str) -> (anim : Animacy) -> (counter : Str) -> (counterReplace : Bool) -> N -- No style variation. Arguments are animacy, counter and whether counter is replaceable.
= \n,a,c,b -> lin N (regNoun n a c b False) ; = \n,a,c,b -> lin N (regNoun n a c b False) ;
mkN : (man : Str) -> (anim : Animateness) -> (counter : Str) -> (counterReplace : Bool) -> mkN : (man : Str) -> (anim : Animacy) -> (counter : Str) -> (counterReplace : Bool) -> (men : Str) -> N -- Like previous, but unpredictable plural.
(men : Str) -> N -- Like previous, but unpredictable plural.
= \n,a,c,b,pl -> lin N (numberNoun n a c b pl False) ; = \n,a,c,b,pl -> lin N (numberNoun n a c b pl False) ;
mkN : (kane,okane : Str) -> (anim : Animateness) -> (counter : Str) -> mkN : (kane,okane : Str) -> (anim : Animacy) -> (counter : Str) -> (counterReplace : Bool) -> N -- Style variation, animacy, counter and whether counter is replaceable.
(counterReplace : Bool) -> N -- Style variation, animacy, counter and whether counter is replaceable.
= \kane,okane,a,c,b -> lin N (styleNoun kane okane a c b False) ; = \kane,okane,a,c,b -> lin N (styleNoun kane okane a c b False) ;
mkN : (tsuma,okusan : Str) -> (anim : Animateness) -> (counter : Str) -> mkN : (tsuma,okusan : Str) -> (anim : Animacy) -> (counter : Str) -> (counterReplace : Bool) -> (tsumatachi : Str) -> N -- Worst case paradigm: style variation, animacy, counter, whether counter is replaceable and unpredictable plural.
(counterReplace : Bool) -> (tsumatachi : Str) -> N -- Worst case paradigm: style variation, animacy, counter, whether counter is replaceable and unpredictable plural.
= \tsuma,okusan,a,c,b,tsumatachi -> = \tsuma,okusan,a,c,b,tsumatachi ->
lin N (mkNoun tsuma okusan tsumatachi tsumatachi a c b False) lin N (mkNoun tsuma okusan tsumatachi tsumatachi a c b False)
} ; } ;
mkN2 : (man : Str) -> (anim : Animateness) -> (counter : Str) -> (counterReplace : Bool) -> mkN2 : (man : Str) -> (anim : Animacy) -> (counter : Str) -> (counterReplace : Bool) -> (men : Str) -> (prep : Str) -> N2 = \n,a,c,b,pl,pr ->
(men : Str) -> (prep : Str) -> N2 = \n,a,c,b,pl,pr ->
lin N2 (numberNoun n a c b pl False) ** {prep = pr ; object = \\st => []} ; lin N2 (numberNoun n a c b pl False) ** {prep = pr ; object = \\st => []} ;
mkN3 : (distance : Str) -> (prep1: Str) -> (prep2: Str) -> (anim : Animateness) -> N3 mkN3 : (distance : Str) -> (prep1: Str) -> (prep2: Str) -> (anim : Animacy) -> N3
= \n,p1,p2,a -> lin N3 (regNoun n a "つ" False True) ** {prep1 = p1; prep2 = p2} ; = \n,p1,p2,a -> lin N3 (regNoun n a "つ" False True) ** {prep1 = p1; prep2 = p2} ;
mkPN = overload { mkPN = overload {
@@ -47,21 +47,24 @@ oper
} ; } ;
mkPron = overload { mkPron = overload {
mkPron : (kare : Str) -> (Pron1Sg : Bool) -> (anim : Animateness) -> Pron mkPron : (kare : Str) -> (Pron1Sg : Bool) -> (anim : Animacy) -> Pron
= \kare,b,a -> lin Pron (regPron kare b a) ; = \kare,b,a -> lin Pron (regPron kare b a) ;
mkPron : (boku,watashi : Str) -> (Pron1Sg : Bool) -> (anim : Animateness) -> Pron mkPron : (boku,watashi : Str) -> (Pron1Sg : Bool) -> (anim : Animacy) -> Pron
= \boku,watashi,b,a -> lin Pron (stylePron boku watashi b a) = \boku,watashi,b,a -> lin Pron (stylePron boku watashi b a)
} ; } ;
mkA = overload { mkA = overload {
mkA : (ookina : Str) -> A = \a -> lin A (regAdj a) ; mkA : (ookina : Str) -> A -- One form for both predicative and attribute
mkA : (kekkonshiteiru,kikonno : Str) -> A = \pred,attr -> lin A (VerbalA pred attr) = \a -> lin A (regAdj a) ;
mkA : (kekkonshiteiru,kikonno : Str) -> A -- Verbal adjective, arguments are predicative and attributive
= \pred,attr -> lin A (VerbalA pred attr)
} ; } ;
mkA2 = overload { mkA2 = overload {
mkA2 : (yasui : Str) -> (prep : Str) -> A2 = \a,p -> lin A2 (regAdj a) ** {prep = p} ; mkA2 : (yasui : Str) -> (prep : Str) -> A2 -- 2-place adjective. Arguments: adjective (same for predicative and attributive) and object marker.
mkA2 : (pred : Str) -> (attr : Str) -> (prep : Str) -> A2 = = \a,p -> lin A2 (regAdj a) ** {prep = p} ;
\pred,attr,pr -> lin A2 (VerbalA pred attr) ** {prep = pr} mkA2 : (pred : Str) -> (attr : Str) -> (prep : Str) -> A2 -- Predicative, attributive and object marker.
= \pred,attr,pr -> lin A2 (VerbalA pred attr) ** {prep = pr}
} ; } ;
mkV = overload { mkV = overload {
@@ -130,6 +133,10 @@ oper
--. --.
-- Hidden definitions -- Hidden definitions
Animacy : Type = ResJpn.Animateness ;
animate : Animacy = ResJpn.Anim ;
inanimate : Animacy = ResJpn.Inanim ;
VerbGroup : Type = ResJpn.VerbGroup ; VerbGroup : Type = ResJpn.VerbGroup ;
gr1 : VerbGroup = Gr1 ; gr1 : VerbGroup = Gr1 ;
gr2 : VerbGroup = Gr2 ; gr2 : VerbGroup = Gr2 ;