1
0
forked from GitHub/gf-rgl

(Kor) Fixes in adverbs + related unit tests

This commit is contained in:
Inari Listenmaa
2020-03-26 20:43:52 +01:00
parent 1acaa57c49
commit dbaa52be08
6 changed files with 27 additions and 8 deletions

View File

@@ -11,7 +11,11 @@ lin
-- ComparAdvAdjS : CAdv -> A -> S -> Adv ; -- more warmly than he runs
-- : Prep -> NP -> Adv ;
PrepNP prep np = {s = glue (np.s ! Bare) prep.s} ;
PrepNP prep np = {
s = case prep.attaches of {
True => glue (np.s ! Bare) prep.s ;
False => np.s ! Bare ++ prep.s }
} ;
-- Adverbs can be modified by 'adadjectives', just like adjectives.

View File

@@ -65,8 +65,10 @@ oper
--2 Structural categories
-- mkPrep = overload {
-- } ;
mkPrep : overload {
mkPrep : (e : Str) -> Prep ; -- Particle like 에, attaches to the NP.
mkPrep : (dwie : Str) -> (attaches : Bool) -> Prep ; -- `mkPrep "뒤에" False` for a postposition that doesn't attach to the NP.
} ;
-- mkConj : (_,_ : Str) -> Number -> Conj = \s1,s2,num ->
-- lin Conj { s = s1 ; s2 = s2 } ;
@@ -128,6 +130,12 @@ oper
-- mkVV = overload {
-- } ;
mkPrep = overload {
mkPrep : (e : Str) -> Prep -- Particle like 에, attaches to the NP.
= \e -> lin Prep (ResKor.mkPrep e) ;
mkPrep : (dwie : Str) -> (attaches : Bool) -> Prep -- `mkPrep "뒤에" False` for a postposition that doesn't attach to the NP.
= \dwie,f -> lin Prep (ResKor.mkPrep dwie ** {attaches = f}) ;
} ;
--------------------------------------------------------------------------------
}

View File

@@ -121,11 +121,11 @@ oper
--------------------------------------------------------------------------------
-- Postpositions
Postposition : Type = SS ;
Postposition : Type = {s : Str ; attaches : Bool} ;
mkPrep : Str -> Postposition = \str -> ss str ;
mkPrep : Str -> Postposition = \str -> {s=str ; attaches=True} ;
emptyPP : Postposition = mkPrep [] ;
emptyPP : Postposition = mkPrep [] ** {attaches=False} ;
datPP : Postposition = mkPrep "에게" ;
--------------------------------------------------------------------------------

View File

@@ -96,7 +96,7 @@ oper
-- lin above_Prep = mkPrep ""
-- lin after_Prep = mkPrep ""
-- lin before_Prep = mkPrep "" ;
-- lin behind_Prep = mkPrep "" ;
lin behind_Prep = mkPrep "뒤에" False ;
-- lin between_Prep = = mkPrep "" ;
-- lin by8agent_Prep = mkPrep ;
-- lin by8means_Prep = mkPrep ;

View File

@@ -130,7 +130,7 @@ lin
-- : Adv -> Comp ;
CompAdv adv = emptyComp ** {
s = \\vf => adv.s ++ copula.s ! vf ;
s = \\vf => adv.s ++ have_V.s ! vf ;
} ;
-- : VP -- Copula alone;

View File

@@ -0,0 +1,7 @@
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAdv (PrepNP in_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N)))))))) NoVoc
LangEng: the cat is in the house
LangKor: 고양이가 집 BIND 에서 있어요
Lang: PhrUtt NoPConj (UttS (UseCl (TTAnt TPres ASimul) PPos (PredVP (DetCN (DetQuant DefArt NumSg) (UseN cat_N)) (UseComp (CompAdv (PrepNP behind_Prep (DetCN (DetQuant DefArt NumSg) (UseN house_N)))))))) NoVoc
LangEng: the cat is behind the house
LangKor: 고양이가 집 뒤에 있어요