mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-20 08:32:50 -06:00
more demo languages; an entry for demo in Make.hs
This commit is contained in:
@@ -3,7 +3,7 @@ module Main where
|
|||||||
import System
|
import System
|
||||||
|
|
||||||
-- Make commands for compiling and testing resource grammars.
|
-- Make commands for compiling and testing resource grammars.
|
||||||
-- usage: runghc Make present? (lang | api | math | pgf | test | clean)?
|
-- usage: runghc Make present? (lang | api | math | pgf | test | demo | clean)?
|
||||||
-- With no argument, lang and api are done, in this order.
|
-- With no argument, lang and api are done, in this order.
|
||||||
-- See 'make' below for what is done by which command.
|
-- See 'make' below for what is done by which command.
|
||||||
|
|
||||||
@@ -38,6 +38,9 @@ langsMath = langsAPI
|
|||||||
-- languages for which to run treebank test
|
-- languages for which to run treebank test
|
||||||
langsTest = langsLang `except` ["Bul","Cat","Hin","Rus","Spa","Tha"]
|
langsTest = langsLang `except` ["Bul","Cat","Hin","Rus","Spa","Tha"]
|
||||||
|
|
||||||
|
-- languages for which to run demo test
|
||||||
|
langsDemo = langsLang `except` ["Bul","Hin","Ina","Rus","Tha"] ---- fix utf8 for Bul,Rus
|
||||||
|
|
||||||
-- languages for which langs.pgf is built
|
-- languages for which langs.pgf is built
|
||||||
langsPGF = langsTest `only` ["Eng","Fre","Swe"]
|
langsPGF = langsTest `only` ["Eng","Fre","Swe"]
|
||||||
|
|
||||||
@@ -70,6 +73,8 @@ make xx = do
|
|||||||
" +RTS -K100M"
|
" +RTS -K100M"
|
||||||
ifxx "test" $ do
|
ifxx "test" $ do
|
||||||
gf treeb $ unwords [dir ++ "/Lang" ++ la ++ ".gfo" | (_,la) <- langsTest]
|
gf treeb $ unwords [dir ++ "/Lang" ++ la ++ ".gfo" | (_,la) <- langsTest]
|
||||||
|
ifxx "demo" $ do
|
||||||
|
gf demos $ unwords ["demo/Demo" ++ la ++ ".gf" | (_,la) <- langsDemo]
|
||||||
ifxx "clean" $ do
|
ifxx "clean" $ do
|
||||||
system "rm */*.gfo ../alltenses/*.gfo ../present/*.gfo"
|
system "rm */*.gfo ../alltenses/*.gfo ../present/*.gfo"
|
||||||
return ()
|
return ()
|
||||||
@@ -87,6 +92,8 @@ gf comm file = do
|
|||||||
treeb = "rf -lines -tree -file=" ++ treebankExx ++
|
treeb = "rf -lines -tree -file=" ++ treebankExx ++
|
||||||
" | l -treebank | wf -file=" ++ treebankResults
|
" | l -treebank | wf -file=" ++ treebankResults
|
||||||
|
|
||||||
|
demos = "gr -number=100 | l -treebank | ps -to_utf8 -to_html | wf -file=resdemo.html"
|
||||||
|
|
||||||
lang (lla,la) = lla ++ "/Lang" ++ la ++ ".gf"
|
lang (lla,la) = lla ++ "/Lang" ++ la ++ ".gf"
|
||||||
try (lla,la) = "api/Try" ++ la ++ ".gf"
|
try (lla,la) = "api/Try" ++ la ++ ".gf"
|
||||||
math (lla,la) = "mathematical/Mathematical" ++ la ++ ".gf"
|
math (lla,la) = "mathematical/Mathematical" ++ la ++ ".gf"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ oper
|
|||||||
Pl => case co of {
|
Pl => case co of {
|
||||||
NCard Masc => "-cents" ;
|
NCard Masc => "-cents" ;
|
||||||
NCard Fem => "-centes" ;
|
NCard Fem => "-centes" ;
|
||||||
_ => variants {} } ;
|
_ => "-cents" ; ---- variants {} } ; ---- AR 23/6/2008
|
||||||
Sg => "cent"
|
Sg => "cent"
|
||||||
} ;
|
} ;
|
||||||
cardOrd1 : CardOrd -> (_,_,_:Str) -> Str = \co,dos,dues,segon -> case co of {
|
cardOrd1 : CardOrd -> (_,_,_:Str) -> Str = \co,dos,dues,segon -> case co of {
|
||||||
|
|||||||
@@ -10,12 +10,12 @@ fun
|
|||||||
|
|
||||||
QuestV : IP -> V -> QCl ;
|
QuestV : IP -> V -> QCl ;
|
||||||
QuestV2 : IP -> V2 -> NP -> QCl ;
|
QuestV2 : IP -> V2 -> NP -> QCl ;
|
||||||
QuestV2Slash : IP -> NP -> V2 -> QCl ;
|
-- QuestV2Slash : IP -> NP -> V2 -> QCl ;
|
||||||
|
|
||||||
UseQCl : Tense -> Ant -> Pol -> QCl -> QS ;
|
UseQCl : Tense -> Ant -> Pol -> QCl -> QS ;
|
||||||
|
|
||||||
ImpV : V -> Imp ;
|
ImpV : V -> Imp ;
|
||||||
ImpV2 : V2 -> NP -> Imp ;
|
-- ImpV2 : V2 -> NP -> Imp ;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
lib/resource-1.4/demo/ClauseCat.gf
Normal file
1
lib/resource-1.4/demo/ClauseCat.gf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
concrete ClauseCat of Clause = CatCat ** ClauseI with (Grammar = GrammarCat) ;
|
||||||
1
lib/resource-1.4/demo/ClauseDan.gf
Normal file
1
lib/resource-1.4/demo/ClauseDan.gf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
concrete ClauseDan of Clause = CatDan ** ClauseI with (Grammar = GrammarDan) ;
|
||||||
@@ -10,11 +10,11 @@ lin
|
|||||||
|
|
||||||
QuestV np v = QuestVP np (UseV v) ;
|
QuestV np v = QuestVP np (UseV v) ;
|
||||||
QuestV2 s v o = QuestVP s (ComplSlash (SlashV2a v) o) ;
|
QuestV2 s v o = QuestVP s (ComplSlash (SlashV2a v) o) ;
|
||||||
QuestV2Slash ip s v = QuestSlash ip (SlashVP s (SlashV2a v)) ;
|
-- QuestV2Slash ip s v = QuestSlash ip (SlashVP s (SlashV2a v)) ;
|
||||||
|
|
||||||
UseQCl = Grammar.UseQCl ;
|
UseQCl = Grammar.UseQCl ;
|
||||||
|
|
||||||
ImpV v = ImpVP (UseV v) ;
|
ImpV v = ImpVP (UseV v) ;
|
||||||
ImpV2 v o = ImpVP (ComplSlash (SlashV2a v) o) ;
|
-- ImpV2 v o = ImpVP (ComplSlash (SlashV2a v) o) ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
1
lib/resource-1.4/demo/ClauseNor.gf
Normal file
1
lib/resource-1.4/demo/ClauseNor.gf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
concrete ClauseNor of Clause = CatNor ** ClauseI with (Grammar = GrammarNor) ;
|
||||||
1
lib/resource-1.4/demo/ClauseRus.gf
Normal file
1
lib/resource-1.4/demo/ClauseRus.gf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
concrete ClauseRus of Clause = CatRus ** ClauseI with (Grammar = GrammarRus) ;
|
||||||
1
lib/resource-1.4/demo/ClauseSpa.gf
Normal file
1
lib/resource-1.4/demo/ClauseSpa.gf
Normal file
@@ -0,0 +1 @@
|
|||||||
|
concrete ClauseSpa of Clause = CatSpa ** ClauseI with (Grammar = GrammarSpa) ;
|
||||||
23
lib/resource-1.4/demo/DemoCat.gf
Normal file
23
lib/resource-1.4/demo/DemoCat.gf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
--# -path=.:alltenses
|
||||||
|
|
||||||
|
concrete DemoCat of Demo =
|
||||||
|
NounCat - [AdvCN,PredetNP,PPartNP,RelNP,RelCN,SentCN,ApposCN,MassNP,DetNP],
|
||||||
|
-- VerbCat,
|
||||||
|
ClauseCat, --
|
||||||
|
AdjectiveCat - [SentAP],
|
||||||
|
AdverbCat,
|
||||||
|
NumeralCat,
|
||||||
|
---- SentenceCat,
|
||||||
|
---- QuestionCat,
|
||||||
|
---- RelativeCat,
|
||||||
|
---- ConjunctionCat,
|
||||||
|
---- PhraseCat,
|
||||||
|
---- TextX - [Tense,TPres,TPast,TFut,TCond],
|
||||||
|
---- IdiomCat,
|
||||||
|
StructuralCat,
|
||||||
|
LexiconCat
|
||||||
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|
||||||
|
} ;
|
||||||
23
lib/resource-1.4/demo/DemoDan.gf
Normal file
23
lib/resource-1.4/demo/DemoDan.gf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
--# -path=.:alltenses
|
||||||
|
|
||||||
|
concrete DemoDan of Demo =
|
||||||
|
NounDan - [AdvCN,PredetNP,PPartNP,RelNP,RelCN,SentCN,ApposCN,MassNP,DetNP],
|
||||||
|
-- VerbDan,
|
||||||
|
ClauseDan, --
|
||||||
|
AdjectiveDan - [SentAP],
|
||||||
|
AdverbDan,
|
||||||
|
NumeralDan,
|
||||||
|
---- SentenceDan,
|
||||||
|
---- QuestionDan,
|
||||||
|
---- RelativeDan,
|
||||||
|
---- ConjunctionDan,
|
||||||
|
---- PhraseDan,
|
||||||
|
---- TextX - [Tense,TPres,TPast,TFut,TCond],
|
||||||
|
---- IdiomDan,
|
||||||
|
StructuralDan,
|
||||||
|
LexiconDan
|
||||||
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|
||||||
|
} ;
|
||||||
23
lib/resource-1.4/demo/DemoNor.gf
Normal file
23
lib/resource-1.4/demo/DemoNor.gf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
--# -path=.:alltenses
|
||||||
|
|
||||||
|
concrete DemoNor of Demo =
|
||||||
|
NounNor - [AdvCN,PredetNP,PPartNP,RelNP,RelCN,SentCN,ApposCN,MassNP,DetNP],
|
||||||
|
-- VerbNor,
|
||||||
|
ClauseNor, --
|
||||||
|
AdjectiveNor - [SentAP],
|
||||||
|
AdverbNor,
|
||||||
|
NumeralNor,
|
||||||
|
---- SentenceNor,
|
||||||
|
---- QuestionNor,
|
||||||
|
---- RelativeNor,
|
||||||
|
---- ConjunctionNor,
|
||||||
|
---- PhraseNor,
|
||||||
|
---- TextX - [Tense,TPres,TPast,TFut,TCond],
|
||||||
|
---- IdiomNor,
|
||||||
|
StructuralNor,
|
||||||
|
LexiconNor
|
||||||
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|
||||||
|
} ;
|
||||||
23
lib/resource-1.4/demo/DemoRus.gf
Normal file
23
lib/resource-1.4/demo/DemoRus.gf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
--# -path=.:alltenses
|
||||||
|
|
||||||
|
concrete DemoRus of Demo =
|
||||||
|
NounRus - [AdvCN,PredetNP,PPartNP,RelNP,RelCN,SentCN,ApposCN,MassNP,DetNP],
|
||||||
|
-- VerbRus,
|
||||||
|
ClauseRus, --
|
||||||
|
AdjectiveRus - [SentAP],
|
||||||
|
AdverbRus,
|
||||||
|
NumeralRus,
|
||||||
|
---- SentenceRus,
|
||||||
|
---- QuestionRus,
|
||||||
|
---- RelativeRus,
|
||||||
|
---- ConjunctionRus,
|
||||||
|
---- PhraseRus,
|
||||||
|
---- TextX - [Tense,TPres,TPast,TFut,TCond],
|
||||||
|
---- IdiomRus,
|
||||||
|
StructuralRus,
|
||||||
|
LexiconRus
|
||||||
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|
||||||
|
} ;
|
||||||
23
lib/resource-1.4/demo/DemoSpa.gf
Normal file
23
lib/resource-1.4/demo/DemoSpa.gf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
--# -path=.:alltenses
|
||||||
|
|
||||||
|
concrete DemoSpa of Demo =
|
||||||
|
NounSpa - [AdvCN,PredetNP,PPartNP,RelNP,RelCN,SentCN,ApposCN,MassNP,DetNP],
|
||||||
|
-- VerbSpa,
|
||||||
|
ClauseSpa, --
|
||||||
|
AdjectiveSpa - [SentAP],
|
||||||
|
AdverbSpa,
|
||||||
|
NumeralSpa,
|
||||||
|
---- SentenceSpa,
|
||||||
|
---- QuestionSpa,
|
||||||
|
---- RelativeSpa,
|
||||||
|
---- ConjunctionSpa,
|
||||||
|
---- PhraseSpa,
|
||||||
|
---- TextX - [Tense,TPres,TPast,TFut,TCond],
|
||||||
|
---- IdiomSpa,
|
||||||
|
StructuralSpa,
|
||||||
|
LexiconSpa
|
||||||
|
** {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|
||||||
|
} ;
|
||||||
Reference in New Issue
Block a user