forked from GitHub/gf-core
some new functions in ResourceDemo
This commit is contained in:
@@ -29,7 +29,7 @@ main = do
|
|||||||
else return ()
|
else return ()
|
||||||
case opts of
|
case opts of
|
||||||
_ | elem "-make" opts || elem "-link" opts -> do
|
_ | elem "-make" opts || elem "-link" opts -> do
|
||||||
let comm = "gf -make -s " ++ unwords (map (++ ".pgf") modus)
|
let comm = "gf -make -s " ++ unwords (map (++ ".pgf") modus) ++" +RTS -K320M -RTS"
|
||||||
putStrLn comm
|
putStrLn comm
|
||||||
system comm
|
system comm
|
||||||
return ()
|
return ()
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
abstract ResourceDemo = Lexicon, Grammar [
|
abstract ResourceDemo = Lexicon, Numeral, Grammar [
|
||||||
|
|
||||||
-- the "mini" resource of GF book, chapter 9
|
-- the "mini" resource of GF book, chapter 9
|
||||||
|
|
||||||
@@ -18,12 +18,15 @@ abstract ResourceDemo = Lexicon, Grammar [
|
|||||||
Tense, -- tense
|
Tense, -- tense
|
||||||
Pol, -- polarity
|
Pol, -- polarity
|
||||||
Conj, -- conjunction
|
Conj, -- conjunction
|
||||||
|
Pron,
|
||||||
|
Numeral,
|
||||||
|
|
||||||
-- fun
|
-- fun
|
||||||
UseCl , -- Tense -> Pol -> Cl -> S,
|
UseCl , -- Tense -> Pol -> Cl -> S,
|
||||||
PredVP , -- NP -> VP -> Cl,
|
PredVP , -- NP -> VP -> Cl,
|
||||||
--- ComplV2, -- V2 -> NP -> VP,
|
--- ComplV2, -- V2 -> NP -> VP,
|
||||||
DetCN , -- Det -> CN -> NP,
|
DetCN , -- Det -> CN -> NP,
|
||||||
|
UsePron,
|
||||||
--- ModCN , -- AP -> CN -> CN,
|
--- ModCN , -- AP -> CN -> CN,
|
||||||
|
|
||||||
--- CompAP , -- AP -> VP,
|
--- CompAP , -- AP -> VP,
|
||||||
@@ -87,9 +90,8 @@ abstract ResourceDemo = Lexicon, Grammar [
|
|||||||
QuestSlash, -- IP -> ClSlash -> QCl, -- who does she walk with
|
QuestSlash, -- IP -> ClSlash -> QCl, -- who does she walk with
|
||||||
QuestIAdv , -- IAdv -> Cl -> QCl, -- why does she walk
|
QuestIAdv , -- IAdv -> Cl -> QCl, -- why does she walk
|
||||||
|
|
||||||
--- SubjCl, -- Cl -> Subj -> S -> Cl, -- she walks because we run
|
SubjCl, -- Cl -> Subj -> S -> Cl, -- she walks because we run
|
||||||
|
|
||||||
--- CompAdv, -- Adv -> VP, -- be here
|
|
||||||
PrepNP , -- Prep -> NP -> Adv, -- in the house
|
PrepNP , -- Prep -> NP -> Adv, -- in the house
|
||||||
|
|
||||||
ComplVS, -- VS -> S -> VP, -- know that she walks
|
ComplVS, -- VS -> S -> VP, -- know that she walks
|
||||||
@@ -104,7 +106,7 @@ abstract ResourceDemo = Lexicon, Grammar [
|
|||||||
UsePN, -- PN -> NP, -- John
|
UsePN, -- PN -> NP, -- John
|
||||||
--- AdvNP, -- NP -> Adv -> NP, -- the man in the city
|
--- AdvNP, -- NP -> Adv -> NP, -- the man in the city
|
||||||
|
|
||||||
who_IP , -- IP,
|
whoSg_IP , -- IP,
|
||||||
here_Adv, -- Adv,
|
here_Adv, -- Adv,
|
||||||
by_Prep, in_Prep, of_Prep, with_Prep, -- Prep,
|
by_Prep, in_Prep, of_Prep, with_Prep, -- Prep,
|
||||||
can_VV, must_VV, want_VV, -- VV,
|
can_VV, must_VV, want_VV, -- VV,
|
||||||
@@ -115,6 +117,7 @@ abstract ResourceDemo = Lexicon, Grammar [
|
|||||||
|
|
||||||
flags startcat = Utt ;
|
flags startcat = Utt ;
|
||||||
|
|
||||||
|
|
||||||
-- functions with different type
|
-- functions with different type
|
||||||
|
|
||||||
fun
|
fun
|
||||||
@@ -127,10 +130,12 @@ fun
|
|||||||
a_Det, the_Det : Det ;
|
a_Det, the_Det : Det ;
|
||||||
this_Det, these_Det : Det ;
|
this_Det, these_Det : Det ;
|
||||||
that_Det, those_Det : Det ;
|
that_Det, those_Det : Det ;
|
||||||
i_NP, youSg_NP, he_NP, she_NP, we_NP, youPl_NP, they_NP : NP ;
|
possDet : Pron -> Det ;
|
||||||
SubjS : Subj -> S -> S -> Utt ; -- if she walks we run
|
numeralDet : Numeral -> Det ;
|
||||||
CompAdv : Adv -> VP ; -- be here
|
i_Pron, youSg_Pron, he_Pron, she_Pron, we_Pron, youPl_Pron, they_Pron : Pron ;
|
||||||
-- SlashV2 : NP -> V2 -> ClSlash ; -- she loves
|
SubjS : Subj -> S -> S -> S ; -- if she walks we run
|
||||||
|
CompAdv : Prep -> NP -> VP ; -- be in the house
|
||||||
|
SlashV2 : NP -> V2 -> ClSlash ; -- she loves
|
||||||
SlashPrep : Cl -> Prep -> ClSlash ; -- she walks with
|
SlashPrep : Cl -> Prep -> ClSlash ; -- she walks with
|
||||||
AdvCN : CN -> Prep -> NP -> CN ; -- man in the city
|
AdvCN : CN -> Prep -> NP -> CN ; -- man in the city
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
--# -path=.:alltenses
|
--# -path=.:alltenses
|
||||||
|
|
||||||
concrete ResourceDemoEng of ResourceDemo = LexiconEng, GrammarEng [
|
concrete ResourceDemoEng of ResourceDemo = LexiconEng, NumeralEng, GrammarEng [
|
||||||
|
|
||||||
-- the "mini" resource of GF book, chapter 9
|
-- used to be the "mini" resource of GF book, chapter 9, but now larger
|
||||||
|
|
||||||
-- cat
|
-- cat
|
||||||
S, -- sentence
|
S, -- sentence
|
||||||
@@ -21,11 +21,15 @@ concrete ResourceDemoEng of ResourceDemo = LexiconEng, GrammarEng [
|
|||||||
Pol, -- polarity
|
Pol, -- polarity
|
||||||
Conj, -- conjunction
|
Conj, -- conjunction
|
||||||
|
|
||||||
|
Pron, -- pronoun
|
||||||
|
Numeral,
|
||||||
|
|
||||||
-- fun
|
-- fun
|
||||||
UseCl , -- Tense -> Pol -> Cl -> S,
|
UseCl , -- Tense -> Pol -> Cl -> S,
|
||||||
PredVP , -- NP -> VP -> Cl,
|
PredVP , -- NP -> VP -> Cl,
|
||||||
--- ComplV2, -- V2 -> NP -> VP,
|
--- ComplV2, -- V2 -> NP -> VP,
|
||||||
DetCN , -- Det -> CN -> NP,
|
DetCN , -- Det -> CN -> NP,
|
||||||
|
UsePron,
|
||||||
--- ModCN , -- AP -> CN -> CN,
|
--- ModCN , -- AP -> CN -> CN,
|
||||||
|
|
||||||
--- CompAP , -- AP -> VP,
|
--- CompAP , -- AP -> VP,
|
||||||
@@ -43,7 +47,7 @@ concrete ResourceDemoEng of ResourceDemo = LexiconEng, GrammarEng [
|
|||||||
every_Det, -- Det,
|
every_Det, -- Det,
|
||||||
--- this_Det, these_Det, -- Det,
|
--- this_Det, these_Det, -- Det,
|
||||||
--- that_Det, those_Det, -- Det,
|
--- that_Det, those_Det, -- Det,
|
||||||
--- i_NP, youSg_NP, he_NP, she_NP, we_NP, youPl_NP, they_NP, -- NP,
|
i_Pron, youSg_Pron, he_Pron, she_Pron, we_Pron, youPl_Pron, they_Pron, -- NP,
|
||||||
very_AdA, -- AdA,
|
very_AdA, -- AdA,
|
||||||
|
|
||||||
TTAnt, -- Tense -> Ant -> Temp ;
|
TTAnt, -- Tense -> Ant -> Temp ;
|
||||||
@@ -91,14 +95,13 @@ concrete ResourceDemoEng of ResourceDemo = LexiconEng, GrammarEng [
|
|||||||
QuestSlash, -- IP -> ClSlash -> QCl, -- who does she walk with
|
QuestSlash, -- IP -> ClSlash -> QCl, -- who does she walk with
|
||||||
QuestIAdv , -- IAdv -> Cl -> QCl, -- why does she walk
|
QuestIAdv , -- IAdv -> Cl -> QCl, -- why does she walk
|
||||||
|
|
||||||
--- SubjCl, -- Cl -> Subj -> S -> Cl, -- she walks because we run
|
SubjCl, -- Cl -> Subj -> S -> Cl, -- she walks because we run
|
||||||
|
|
||||||
--- CompAdv, -- Adv -> VP, -- be here
|
|
||||||
PrepNP , -- Prep -> NP -> Adv, -- in the house
|
PrepNP , -- Prep -> NP -> Adv, -- in the house
|
||||||
|
|
||||||
--- ComplVS, -- VS -> S -> VP, -- know that she walks
|
ComplVS, -- VS -> S -> VP, -- know that she walks
|
||||||
--- ComplVQ, -- VQ -> QS -> VP, -- wonder who walks
|
ComplVQ, -- VQ -> QS -> VP, -- wonder who walks
|
||||||
--- ComplVV, -- VV -> VP -> VP, -- want to walk
|
ComplVV, -- VV -> VP -> VP, -- want to walk
|
||||||
|
|
||||||
--- SlashV2 , -- NP -> V2 -> ClSlash, -- she loves
|
--- SlashV2 , -- NP -> V2 -> ClSlash, -- she loves
|
||||||
--- SlashPrep, -- Cl -> Prep -> ClSlash, -- she walks with
|
--- SlashPrep, -- Cl -> Prep -> ClSlash, -- she walks with
|
||||||
@@ -108,7 +111,7 @@ concrete ResourceDemoEng of ResourceDemo = LexiconEng, GrammarEng [
|
|||||||
UsePN, -- PN -> NP, -- John
|
UsePN, -- PN -> NP, -- John
|
||||||
--- AdvNP, -- NP -> Adv -> NP, -- the man in the city
|
--- AdvNP, -- NP -> Adv -> NP, -- the man in the city
|
||||||
|
|
||||||
who_IP , -- IP,
|
whoSg_IP , -- IP,
|
||||||
here_Adv, -- Adv,
|
here_Adv, -- Adv,
|
||||||
by_Prep, in_Prep, of_Prep, with_Prep, -- Prep,
|
by_Prep, in_Prep, of_Prep, with_Prep, -- Prep,
|
||||||
can_VV, must_VV, want_VV, -- VV,
|
can_VV, must_VV, want_VV, -- VV,
|
||||||
@@ -132,16 +135,11 @@ lin
|
|||||||
these_Det = S.these_Det ;
|
these_Det = S.these_Det ;
|
||||||
that_Det = S.that_Det ;
|
that_Det = S.that_Det ;
|
||||||
those_Det = S.those_Det ;
|
those_Det = S.those_Det ;
|
||||||
i_NP = S.i_NP ;
|
possDet p = S.mkDet <p : Pron> ;
|
||||||
youSg_NP = S.you_NP ;
|
numeralDet n = S.mkDet <n : Numeral> ;
|
||||||
he_NP = S.he_NP ;
|
SubjS subj a b = mkS (S.mkAdv <subj : Subj> <a : S>) b ;
|
||||||
she_NP = S.she_NP ;
|
CompAdv p pp = mkVP (S.mkAdv <p : Prep> <pp : NP>) ;
|
||||||
we_NP = S.we_NP ;
|
SlashV2 np v2 = mkClSlash np v2 ;
|
||||||
youPl_NP = S.youPl_NP ;
|
|
||||||
they_NP = S.they_NP ;
|
|
||||||
SubjS subj a b = mkUtt (mkS (S.mkAdv <subj : Subj> <a : S>) b) ;
|
|
||||||
CompAdv adv = mkVP (lin Adv adv) ;
|
|
||||||
-- SlashV2 np v2 = mkClSlash np v2 ;
|
|
||||||
SlashPrep cl p = mkClSlash (lin Cl cl) <p : Prep> ;
|
SlashPrep cl p = mkClSlash (lin Cl cl) <p : Prep> ;
|
||||||
AdvCN cn p pp = mkCN <lin CN cn : CN> (mkAdv <p : Prep> <pp : NP>) ;
|
AdvCN cn p pp = mkCN <lin CN cn : CN> (mkAdv <p : Prep> <pp : NP>) ;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user