From 50f8db750a073e0db7fa6b70c1c2c623030d7ae4 Mon Sep 17 00:00:00 2001 From: aarne Date: Mon, 9 Mar 2009 16:53:40 +0000 Subject: [PATCH] tested "minimal" resource to compile Foods and Bronzeage --- examples/bronzeage/BronzeageEng.gf | 2 +- examples/bronzeage/SwadeshEng.gf | 1 - examples/tutorial/resource-foods/FoodsEng.gf | 10 ++++---- examples/tutorial/resource-foods/FoodsI.gf | 12 +++++----- examples/tutorial/resource-foods/FoodsIta.gf | 2 +- next-lib/src/Make.hs | 12 ++++++++++ next-lib/src/api/Constructors.gf | 24 ++++++++++---------- next-lib/src/api/minimals.txt | 13 +---------- 8 files changed, 38 insertions(+), 38 deletions(-) diff --git a/examples/bronzeage/BronzeageEng.gf b/examples/bronzeage/BronzeageEng.gf index 162a41705..7cb878ea1 100644 --- a/examples/bronzeage/BronzeageEng.gf +++ b/examples/bronzeage/BronzeageEng.gf @@ -1,4 +1,4 @@ ---# -path=.:present +--# -path=.:minimal:present concrete BronzeageEng of Bronzeage = SwadeshEng ** BronzeageI with (Syntax = SyntaxEng) ** open ResEng in { diff --git a/examples/bronzeage/SwadeshEng.gf b/examples/bronzeage/SwadeshEng.gf index a3db1bc9a..7ebab9596 100644 --- a/examples/bronzeage/SwadeshEng.gf +++ b/examples/bronzeage/SwadeshEng.gf @@ -2,6 +2,5 @@ concrete SwadeshEng of Swadesh = SwadeshI with (Syntax = SyntaxEng), - (L = LexiconEng), (Lexicon = LexiconEng) ; diff --git a/examples/tutorial/resource-foods/FoodsEng.gf b/examples/tutorial/resource-foods/FoodsEng.gf index 90ae07f01..5c2158ce2 100644 --- a/examples/tutorial/resource-foods/FoodsEng.gf +++ b/examples/tutorial/resource-foods/FoodsEng.gf @@ -1,4 +1,4 @@ ---# -path=.:../foods:present:prelude +--# -path=.:../foods:minimal:present concrete FoodsEng of Foods = open SyntaxEng,ParadigmsEng in { lincat @@ -8,10 +8,10 @@ concrete FoodsEng of Foods = open SyntaxEng,ParadigmsEng in { Quality = AP ; lin Is item quality = mkCl item quality ; - This kind = mkNP this_QuantSg kind ; - That kind = mkNP that_QuantSg kind ; - These kind = mkNP these_QuantPl kind ; - Those kind = mkNP those_QuantPl kind ; + This kind = mkNP this_Quant kind ; + That kind = mkNP that_Quant kind ; + These kind = mkNP this_Quant plNum kind ; + Those kind = mkNP that_Quant plNum kind ; QKind quality kind = mkCN quality kind ; Wine = mkCN (mkN "wine") ; Pizza = mkCN (mkN "pizza") ; diff --git a/examples/tutorial/resource-foods/FoodsI.gf b/examples/tutorial/resource-foods/FoodsI.gf index e19e3c6a4..0f0c7a5c3 100644 --- a/examples/tutorial/resource-foods/FoodsI.gf +++ b/examples/tutorial/resource-foods/FoodsI.gf @@ -2,16 +2,16 @@ incomplete concrete FoodsI of Foods = open Syntax, LexFoods in { lincat - Phrase = Cl ; + Phrase = Utt ; Item = NP ; Kind = CN ; Quality = AP ; lin - Is item quality = mkCl item quality ; - This kind = mkNP this_QuantSg kind ; - That kind = mkNP that_QuantSg kind ; - These kind = mkNP these_QuantPl kind ; - Those kind = mkNP those_QuantPl kind ; + Is item quality = mkUtt (mkCl item quality) ; + This kind = mkNP this_Quant kind ; + That kind = mkNP that_Quant kind ; + These kind = mkNP this_Quant plNum kind ; + Those kind = mkNP that_Quant plNum kind ; QKind quality kind = mkCN quality kind ; Very quality = mkAP very_AdA quality ; diff --git a/examples/tutorial/resource-foods/FoodsIta.gf b/examples/tutorial/resource-foods/FoodsIta.gf index 7158d77f9..9189a1761 100644 --- a/examples/tutorial/resource-foods/FoodsIta.gf +++ b/examples/tutorial/resource-foods/FoodsIta.gf @@ -1,4 +1,4 @@ ---# -path=.:../foods:present:prelude +--# -path=.:../foods:minimal:present:prelude concrete FoodsIta of Foods = FoodsI with (Syntax = SyntaxIta), diff --git a/next-lib/src/Make.hs b/next-lib/src/Make.hs index 8ab2a4f44..53428586e 100644 --- a/next-lib/src/Make.hs +++ b/next-lib/src/Make.hs @@ -55,6 +55,9 @@ langsLang = langs `except` ["Ara","Ina"] -- languages for which to compile Try langsAPI = langsLang `except` ["Ara","Hin","Ina","Tha"] +-- languages for which to compile minimal Syntax +langsMinimal = langs `only` ["Eng","Bul","Ita"] + -- languages for which to run treebank test langsTest = langsLang `except` ["Ara","Bul","Cat","Hin","Rus","Spa","Tha"] @@ -97,6 +100,9 @@ make xx = do mapM_ (gfc pres presApiPath . try) (optl langsAPI) mapM_ (gfc pres presApiPath . symbolic) (optl langsAPI) copy "*/*.gfo" dir + ifx "minimal" $ do + mapM_ (gfcmin presApiPath . syntax) (optl langsMinimal) + copy "api/*.gfo" "../minimal" ifxx "pgf" $ do run_gfc $ ["-s","--make","--name=langs","--parser=off", "--output-dir=" ++ dir] @@ -126,6 +132,11 @@ gfc pres ppath file = do putStrLn $ "Compiling " ++ file run_gfc ["-s","-src", preproc, path, file] +gfcmin path file = do + let preproc = "-preproc=./mkMinimal" + putStrLn $ "Compiling minimal " ++ file + run_gfc ["-s","-src", preproc, path, file] + gf comm file = do putStrLn $ "Reading " ++ file let cmd = "echo \"" ++ comm ++ "\" | gf -s " ++ file @@ -142,6 +153,7 @@ lang (lla,la) = lla ++ "/All" ++ la ++ ".gf" compat (lla,la) = lla ++ "/Compatibility" ++ la ++ ".gf" symbol (lla,la) = lla ++ "/Symbol" ++ la ++ ".gf" try (lla,la) = "api/Try" ++ la ++ ".gf" +syntax (lla,la) = "api/Syntax" ++ la ++ ".gf" symbolic (lla,la) = "api/Symbolic" ++ la ++ ".gf" parse (lla,la) = "parse/Parse" ++ la ++ ".gf" diff --git a/next-lib/src/api/Constructors.gf b/next-lib/src/api/Constructors.gf index fd49895c5..a407c3440 100644 --- a/next-lib/src/api/Constructors.gf +++ b/next-lib/src/api/Constructors.gf @@ -962,8 +962,8 @@ incomplete resource Constructors = open Grammar in { = \y -> ExistNP (DetArtSg IndefArt y) ; --# notminimal mkCl : NP -> Cl -- there is a house --# notminimal = ExistNP ; --# notminimal - mkCl : NP -> AP -> Cl -- John is nice and warm --# notminimal - = \x,y -> PredVP x (UseComp (CompAP y)) ; --# notminimal + mkCl : NP -> AP -> Cl -- John is nice and warm + = \x,y -> PredVP x (UseComp (CompAP y)) ; mkCl : NP -> A -> Cl -- John is warm = \x,y -> PredVP x (UseComp (CompAP (PositA y))) ; mkCl : NP -> A -> NP -> Cl -- John is warmer than Mary @@ -1124,8 +1124,8 @@ incomplete resource Constructors = open Grammar in { mkCard = overload { mkCard : Numeral -> Card = NumNumeral ; - mkCard : Digits -> Card -- 51 - = NumDigits ; + mkCard : Digits -> Card -- 51 --# notminimal + = NumDigits ; --# notminimal mkCard : AdN -> Card -> Card --# notminimal = AdNum --# notminimal } ; @@ -1539,11 +1539,11 @@ incomplete resource Constructors = open Grammar in { = \t,u -> {s = t.s ++ u.s ; lock_Text = <>} ; --# notminimal } ; - mkVP = overload { --# notminimal - mkVP : V -> VP -- sleep --# notminimal - = UseV ; --# notminimal - mkVP : V2 -> NP -> VP -- use it --# notminimal - = ComplV2 ; --# notminimal + mkVP = overload { + mkVP : V -> VP -- sleep + = UseV ; + mkVP : V2 -> NP -> VP -- use it + = ComplV2 ; mkVP : V3 -> NP -> NP -> VP -- send a message to her --# notminimal = ComplV3 ; --# notminimal mkVP : VV -> VP -> VP -- want to run --# notminimal @@ -1580,15 +1580,15 @@ incomplete resource Constructors = open Grammar in { = \y -> (UseComp (CompNP (DetArtSg IndefArt (UseN y)))) ; --# notminimal mkVP : Adv -> VP -- be here --# notminimal = \a -> UseComp (CompAdv a) ; --# notminimal - mkVP : VP -> Adv -> VP -- sleep here --# notminimal - = AdvVP ; --# notminimal + mkVP : VP -> Adv -> VP -- sleep here + = AdvVP ; mkVP : AdV -> VP -> VP -- always sleep --# notminimal = AdVVP ; --# notminimal mkVP : VPSlash -> NP -> VP -- always sleep --# notminimal = ComplSlash ; --# notminimal mkVP : VPSlash -> VP --# notminimal = ReflVP --# notminimal - } ; --# notminimal + } ; reflexiveVP : V2 -> VP = \v -> ReflVP (SlashV2a v) ; --# notminimal diff --git a/next-lib/src/api/minimals.txt b/next-lib/src/api/minimals.txt index 8c3bd21f0..93f915b02 100644 --- a/next-lib/src/api/minimals.txt +++ b/next-lib/src/api/minimals.txt @@ -1,16 +1,13 @@ ASimul AdAP AdjCN +AdvVP CompAP CompAdv CompNP ComparA ComplSlash -ComplV2 -ComplV3 DefArt -DetArtCard -DetArtSg DetCN DetQuant Grammar @@ -22,22 +19,17 @@ MassNP NoPConj NoVoc NumCard -NumDigits NumNumeral NumPl NumSg -PExclMark -PFullStop PNeg PPos -PQuestMark PhrUtt PositA PositAdvAdj PredVP PredetNP PrepNP -Quant QuestCl QuestIAdv QuestVP @@ -45,14 +37,11 @@ Slash3V3 SlashV2A SlashV2a TEmpty -TEmpty; TExclMark TFullStop TPres TQuestMark TTAnt -TUseCl -TUseQCl UseCl UseComp UseN