forked from GitHub/comp-syntax-gu-mlt
first Nobel grammar
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
abstract Labels = {
|
||||
cat Country ;
|
||||
cat Award ;
|
||||
|
||||
fun Q800_Costa_Rica_Country : Country ;
|
||||
fun Q219060_State_of_Palestine_Country : Country ;
|
||||
fun Q37_Lithuania_Country : Country ;
|
||||
@@ -109,4 +113,5 @@ fun Q180114_Ayyubid_dynasty_Country : Country ;
|
||||
fun Q8733_Qing_dynasty_Country : Country ;
|
||||
fun Q96_Mexico_Country : Country ;
|
||||
fun Q884_South_Korea_Country : Country ;
|
||||
fun Q114_Kenya_Country : Country ;
|
||||
fun Q114_Kenya_Country : Country ;
|
||||
}
|
||||
|
||||
@@ -1,3 +1,19 @@
|
||||
concrete LabelsEng of Labels = open SyntaxEng, ParadigmsEng in {
|
||||
|
||||
lincat Country = NP ;
|
||||
lincat Award = NP ;
|
||||
|
||||
oper mkCountry = overload {
|
||||
mkCountry : Str -> NP = \s -> mkNP (mkPN s) ;
|
||||
mkCountry : NP -> NP = \np -> np ;
|
||||
} ;
|
||||
|
||||
oper mkAward = overload {
|
||||
mkAward : Str -> NP = \s -> mkNP (mkPN s) ;
|
||||
mkAward : NP -> NP = \np -> np ;
|
||||
} ;
|
||||
|
||||
|
||||
lin Q800_Costa_Rica_Country = mkCountry "Costa Rica" ;
|
||||
lin Q219060_State_of_Palestine_Country = mkCountry "State of Palestine" ;
|
||||
lin Q37_Lithuania_Country = mkCountry "Lithuania" ;
|
||||
@@ -110,3 +126,5 @@ lin Q8733_Qing_dynasty_Country = mkCountry "Qing dynasty" ;
|
||||
lin Q96_Mexico_Country = mkCountry "Mexico" ;
|
||||
lin Q884_South_Korea_Country = mkCountry "South Korea" ;
|
||||
lin Q114_Kenya_Country = mkCountry "Kenya" ;
|
||||
|
||||
}
|
||||
17
lab2/grammars/Nobel.gf
Normal file
17
lab2/grammars/Nobel.gf
Normal file
@@ -0,0 +1,17 @@
|
||||
abstract Nobel = Labels ** {
|
||||
|
||||
flags startcat = Description ;
|
||||
|
||||
cat
|
||||
Description ;
|
||||
Name ;
|
||||
Date ;
|
||||
|
||||
fun
|
||||
LivingDescription : Name -> Name -> Country -> Date -> Date -> Award -> Description ;
|
||||
PastDescription : Name -> Name -> Country -> Date -> Date -> Date -> Award -> Description ;
|
||||
StringName : String -> Name ;
|
||||
YearDate : Int -> Date ;
|
||||
he_Name, she_Name, they_Name : Name ;
|
||||
|
||||
}
|
||||
32
lab2/grammars/NobelEng.gf
Normal file
32
lab2/grammars/NobelEng.gf
Normal file
@@ -0,0 +1,32 @@
|
||||
concrete NobelEng of Nobel = LabelsEng ** open
|
||||
SyntaxEng,
|
||||
ParadigmsEng,
|
||||
SymbolicEng,
|
||||
IrregEng
|
||||
in {
|
||||
|
||||
lincat
|
||||
Description = Text ;
|
||||
Name = NP ;
|
||||
Date = Adv ;
|
||||
|
||||
lin
|
||||
LivingDescription name pron country birthdate awarddate award =
|
||||
mkText
|
||||
(mkPhr (mkS pastTense (mkCl name (mkVP (mkVP born_VP (inAdv country)) birthdate))))
|
||||
(mkText (mkS pastTense (mkCl pron (mkVP (mkVP (mkV2 get_V) award) awarddate)))) ;
|
||||
|
||||
-- PastDescription : Name -> Country -> Date -> Date -> Award -> Description ;
|
||||
StringName s = symb s ;
|
||||
|
||||
YearDate i = inAdv <symb i : NP> ;
|
||||
|
||||
he_Name = he_NP ;
|
||||
she_Name = she_NP ;
|
||||
they_Name = they_NP ;
|
||||
|
||||
oper
|
||||
inAdv : NP -> Adv = \np -> SyntaxEng.mkAdv in_Prep np ;
|
||||
born_VP = mkVP (mkA "born") ;
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user