diff --git a/lib/src/demo/Compile.hs b/lib/src/demo/Compile.hs index 1396c5489..f55df846f 100644 --- a/lib/src/demo/Compile.hs +++ b/lib/src/demo/Compile.hs @@ -37,7 +37,8 @@ main = do _ -> return () compileOne modu = do - let comm = "gf -make -s -optimize-pgf -name=" ++ +---- let comm = "gf -make -s -optimize-pgf -name=" ++ + let comm = "gf -make -s -name=" ++ modu ++ " " ++ modu ++ ".gf" ++ " +RTS -K320M" putStrLn comm diff --git a/lib/src/demo/ResourceDemo.gf b/lib/src/demo/ResourceDemo.gf index a9985b7a9..59b9c74c9 100644 --- a/lib/src/demo/ResourceDemo.gf +++ b/lib/src/demo/ResourceDemo.gf @@ -20,6 +20,8 @@ abstract ResourceDemo = Lexicon, Numeral, Grammar [ Conj, -- conjunction Pron, Numeral, + Interj, + Phr, -- fun UseCl , -- Tense -> Pol -> Cl -> S, @@ -70,6 +72,7 @@ abstract ResourceDemo = Lexicon, Numeral, Grammar [ PN, -- proper name e.g. "John" Subj, -- subjunction e.g. "because" IAdv, -- interrogative adverb e.g. "why" + IComp, ListAP, ListNP, @@ -82,6 +85,14 @@ abstract ResourceDemo = Lexicon, Numeral, Grammar [ -- fun UttS , -- S -> Utt, UttQS, -- QS -> Utt, + UttNP, + UttCN, + UttAdv, + UttVP, + UttImp, + UttIP, + UttIAdv, + UttInterj, UseQCl, -- Tense -> Pol -> QCl -> QS, @@ -89,6 +100,8 @@ abstract ResourceDemo = Lexicon, Numeral, Grammar [ QuestVP , -- IP -> VP -> QCl, -- who walks QuestSlash, -- IP -> ClSlash -> QCl, -- who does she walk with QuestIAdv , -- IAdv -> Cl -> QCl, -- why does she walk + QuestIComp, + CompIAdv, SubjCl, -- Cl -> Subj -> S -> Cl, -- she walks because we run @@ -116,12 +129,14 @@ abstract ResourceDemo = Lexicon, Numeral, Grammar [ ] ** { -flags startcat = Text ; +flags startcat = Phr ; -- functions with different type fun + PhrUtt : Utt -> Phr ; + TextS : S -> Text ; -- with . TextQS : QS -> Text ; -- with ? TextImp : VP -> Text ; -- with ! @@ -129,6 +144,9 @@ fun ComplV2 : V2 -> NP -> VP ; ModCN : AP -> CN -> CN ; CompAP : AP -> VP ; + CompCN : CN -> VP ; + CompNP : NP -> VP ; + CompAdv : Adv -> VP ; ConjS : Conj -> S -> S -> S ; ConjAP : Conj -> AP -> AP -> AP ; ConjNP : Conj -> NP -> NP -> NP ; @@ -139,7 +157,6 @@ fun numeralDet : Numeral -> Det ; i_Pron, youSg_Pron, he_Pron, she_Pron, we_Pron, youPl_Pron, they_Pron : Pron ; 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 AdvCN : CN -> Prep -> NP -> CN ; -- man in the city diff --git a/lib/src/demo/ResourceDemoEng.gf b/lib/src/demo/ResourceDemoEng.gf index cf1e079a9..09eeb4e60 100644 --- a/lib/src/demo/ResourceDemoEng.gf +++ b/lib/src/demo/ResourceDemoEng.gf @@ -20,9 +20,10 @@ concrete ResourceDemoEng of ResourceDemo = LexiconEng, NumeralEng, GrammarEng [ Tense, -- tense Pol, -- polarity Conj, -- conjunction - Pron, -- pronoun Numeral, + Interj, + Phr, -- fun UseCl , -- Tense -> Pol -> Cl -> S, @@ -75,6 +76,7 @@ concrete ResourceDemoEng of ResourceDemo = LexiconEng, NumeralEng, GrammarEng [ PN, -- proper name e.g. "John" Subj, -- subjunction e.g. "because" IAdv, -- interrogative adverb e.g. "why" + IComp, ListAP, ListNP, @@ -89,6 +91,14 @@ concrete ResourceDemoEng of ResourceDemo = LexiconEng, NumeralEng, GrammarEng [ UttS , -- S -> Utt, UttQS, -- QS -> Utt, + UttNP, + UttCN, + UttAdv, + UttVP, + UttImp, + UttIP, + UttIAdv, + UttInterj, UseQCl, -- Tense -> Pol -> QCl -> QS, @@ -96,6 +106,8 @@ concrete ResourceDemoEng of ResourceDemo = LexiconEng, NumeralEng, GrammarEng [ QuestVP , -- IP -> VP -> QCl, -- who walks QuestSlash, -- IP -> ClSlash -> QCl, -- who does she walk with QuestIAdv , -- IAdv -> Cl -> QCl, -- why does she walk + QuestIComp, + CompIAdv, SubjCl, -- Cl -> Subj -> S -> Cl, -- she walks because we run @@ -126,6 +138,8 @@ concrete ResourceDemoEng of ResourceDemo = LexiconEng, NumeralEng, GrammarEng [ -- functions with different type lin + PhrUtt u = mkPhr (lin Utt u) ; + TextS s = mkText (lin S s) ; TextQS qs = mkText (lin QS qs) ; TextImp vp = mkText (mkImp (lin VP vp)) ; @@ -133,6 +147,9 @@ lin ComplV2 v np = mkVP v np ; ModCN ap cn = lin CN (mkCN ) ; CompAP ap = mkVP <(lin AP ap) : AP> ; + CompCN ap = mkVP <(lin CN ap) : CN> ; + CompNP ap = mkVP <(lin NP ap) : NP> ; + CompAdv ap = mkVP <(lin Adv ap) : Adv> ; ConjS co x y = mkS (lin Conj co) (lin S x) (lin S y) ; ConjAP co x y = mkAP co x y ; ConjNP co x y = mkNP co x y ; @@ -147,7 +164,6 @@ lin possDet p = S.mkDet

; numeralDet n = S.mkDet ; SubjS subj a b = mkS (S.mkAdv ) b ; - CompAdv p pp = mkVP (S.mkAdv

) ; SlashV2 np v2 = mkClSlash np v2 ; SlashPrep cl p = mkClSlash (lin Cl cl)

; AdvCN cn p pp = mkCN (mkAdv

) ;