1
0
forked from GitHub/gf-rgl

fix word order of question

This commit is contained in:
Meowyam
2021-11-15 12:19:31 +08:00
committed by Inari Listenmaa
parent 23493335bb
commit b8a1a72cca
5 changed files with 46 additions and 15 deletions

View File

@@ -56,7 +56,7 @@ concrete NounEng of Noun = CatEng ** open MorphoEng, ResEng, Prelude in {
DetNP det = {
-- s = case det.hasNum of {True => \\_ => det.s ; _ => \\c => det.sp ! c} ;
s = det.sp ! Neutr ! False ;
s = \\c => det.sp ! Neutr ! False ! c ++ "whatevr" ;
a = agrP3 det.n
} ;

View File

@@ -25,8 +25,8 @@ concrete CatMay of Cat = CommonX ** open ResMay, Prelude in {
QCl = ResMay.Clause ;
IComp = SS ; -- interrogative complement of copula e.g. "where"
IDet = ResMay.Determiner ; -- interrogative determiner e.g. "how many"
IQuant = ResMay.Quant ; -- interrogative quantifier e.g. "which"
IP = ResMay.NounPhrase ; -- interrogative pronoun e.g. "who"
IQuant = ResMay.IQuant ; -- interrogative quantifier e.g. "which"
IP = ResMay.IPhrase ; -- interrogative pronoun e.g. "who"
--2 Subord clauses and pronouns

View File

@@ -8,13 +8,24 @@ concrete QuestionMay of Question = CatMay ** open
-- determiners, with or without a noun.
lin
-- : IDet -> CN -> IP ; -- which five songs
IdetCN idet cn = NM.DetCN idet cn ;
IdetCN idet cn = NM.DetCN idet cn ** {sp = idet.sp} ;
-- : IDet -> IP ; -- which five
IdetIP idet = NM.DetNP idet ;
IdetIP idet = NM.DetNP idet ** {sp = idet.sp};
-- : IQuant -> Num -> IDet ; -- which (five)
IdetQuant = NM.DetQuant ;
IdetQuant iquant num = iquant ** {
pr = num.s ++ case iquant.isPre of {True => iquant.s ; False => [] } ;
-- if isPre is True, then: "berapa kucing"
s = case iquant.isPre of { False => iquant.s ; True => [] };
-- if isPre is False, use s: "kucing berapa"
n = num.n
} ;
-- : IP -> ClSlash -> QCl ; -- whom does John love
QuestSlash ip cls = cls ** {
pred = \\vf,pol => cls.pred ! vf ! pol ++ ip.s ! Bare
} ;
{-
lin
@@ -24,9 +35,6 @@ lin
-- : IP -> VP -> QCl ;
QuestVP ip vp =
-- : IP -> ClSlash -> QCl ; -- whom does John love
QuestSlash ip cls =
-- : IAdv -> Cl -> QCl ; -- why does John walk
QuestIAdv iadv cls =

View File

@@ -50,6 +50,10 @@ oper
empty : Str ; -- need to avoid GF being silly. See https://inariksit.github.io/gf/2018/08/28/gf-gotchas.html#metavariables-or-those-question-marks-that-appear-when-parsing
} ;
IPhrase : Type = NounPhrase ** {
sp : NForm => Str ; -- standalone berapa banyak kucing
} ;
emptyNP : NounPhrase = {
s = \\_ => [] ;
a = NotPron ;
@@ -60,11 +64,15 @@ oper
-- Det, Quant, Card, Ord
Quant : Type = {
s : Str ;
sp : NForm => Str ;
s : Str ; -- quantifier in a context, eg. 'berapa (kucing)'
sp : NForm => Str ; -- a standalone, eg. '(kucing) berapa banyak'
poss : Possession ;
} ;
IQuant : Type = Quant ** {
isPre : Bool ;
} ;
Determiner : Type = Quant ** {
pr : Str ; -- prefix for numbers
n : NumType ; -- number as in 5 (noun in singular), Sg or Pl
@@ -102,6 +110,18 @@ oper
sp = \\_ => str
} ;
mkDet : Str -> Number -> Determiner = \str, num -> mkQuant str ** {
pr = "" ;
n = NoNum num ;
} ;
mkIdet : Str -> Number -> Bool -> Determiner = \str, num, isPre -> mkDet str num ** {
pr = case isPre of {True => str ; False => [] } ;
-- if isPre is True, then: "berapa kucing"
s = case isPre of { False => str ; True => [] };
} ;
--------------------------------------------------------------------------------
-- Prepositions

View File

@@ -52,9 +52,9 @@ lin and_Conj = {s2 = "dan" ; s1 = [] ; n = Pl} ;
-----------------
-- *Det and Quant
{-
lin how8many_IDet = ;
lin how8many_IDet = mkIdet "berapa banyak" Pl True;
{-}
lin all_Predet = {s = ""} ;
lin not_Predet = { s = "" } ;
lin only_Predet = { s = "" } ;
@@ -71,7 +71,7 @@ lin someSg_Det =
lin no_Quant = -}
lin that_Quant = mkQuant "itu" ;
lin this_Quant = mkQuant "ini" ;
lin which_IQuant = mkQuant "apa" ;
lin which_IQuant = mkQuant "apa" ** {isPre = False} ;
-----
@@ -154,7 +154,10 @@ lin language_title_Utt = ss "bahasa Melayu" ;
-------
-- Verb
--lin have_V2 = mkV2 have_V ;
lin have_V2 = let have' : V2 = mkV2 "ada" in have' ** {
s = \\_ => "ada" ;
passive = "diadakan" ;
} ;
-- lin can8know_VV = can_VV ; -- can (capacity)
-- lin can_VV = mkVV "" ; -- can (possibility)
-- lin must_VV = mkVV "" ;