mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-21 00:52:51 -06:00
Moved the different versions of the toy0 concrete modules to different subdirectories.
This commit is contained in:
28
examples/regulus/toy0/no-resource/Toy0Eng.gf
Normal file
28
examples/regulus/toy0/no-resource/Toy0Eng.gf
Normal file
@@ -0,0 +1,28 @@
|
||||
--# -path=..
|
||||
concrete Toy0Eng of Toy0 = {
|
||||
|
||||
param
|
||||
Number = Sg | Pl ;
|
||||
|
||||
lincat
|
||||
Spec = {s : Str ; n : Number} ;
|
||||
Noun = {s : Number => Str} ;
|
||||
NP = {s : Str} ;
|
||||
|
||||
lin
|
||||
SpecNoun spec noun = {s = spec.s ++ noun.s ! spec.n} ;
|
||||
|
||||
One = {s = "one" ; n = Sg} ;
|
||||
Two = {s = "two" ; n = Pl} ;
|
||||
|
||||
Felis = regNoun "cat" ;
|
||||
Canis = regNoun "dog" ;
|
||||
|
||||
oper
|
||||
regNoun : Str -> {s : Number => Str} = \s -> {
|
||||
s = table {
|
||||
Sg => s ;
|
||||
Pl => s + "s"
|
||||
}
|
||||
} ;
|
||||
}
|
||||
30
examples/regulus/toy0/no-resource/Toy0Fre.gf
Normal file
30
examples/regulus/toy0/no-resource/Toy0Fre.gf
Normal file
@@ -0,0 +1,30 @@
|
||||
--# -path=..
|
||||
concrete Toy0Fre of Toy0 = {
|
||||
|
||||
param
|
||||
Number = Sg | Pl ;
|
||||
Gender = Masc | Fem ;
|
||||
|
||||
lincat
|
||||
Spec = {s : Gender => Str ; n : Number} ;
|
||||
Noun = {s : Number => Str ; g : Gender} ;
|
||||
NP = {s : Str} ;
|
||||
|
||||
lin
|
||||
SpecNoun spec noun = {s = spec.s ! noun.g ++ noun.s ! spec.n} ;
|
||||
|
||||
One = {s = table {Fem => "une" ; _ => "un"} ; n = Sg} ;
|
||||
Two = {s = \\_ => "deux" ; n = Pl} ;
|
||||
|
||||
Felis = mkNoun "chat" Masc ;
|
||||
Canis = mkNoun "chien" Masc ;
|
||||
|
||||
oper
|
||||
mkNoun : Str -> Gender -> {s : Number => Str ; g : Gender} = \s,g -> {
|
||||
s = table {
|
||||
Sg => s ;
|
||||
Pl => s + "s"
|
||||
} ;
|
||||
g = g
|
||||
} ;
|
||||
}
|
||||
31
examples/regulus/toy0/no-resource/Toy0Ger.gf
Normal file
31
examples/regulus/toy0/no-resource/Toy0Ger.gf
Normal file
@@ -0,0 +1,31 @@
|
||||
--# -path=..
|
||||
concrete Toy0Ger of Toy0 = {
|
||||
|
||||
param
|
||||
Number = Sg | Pl ;
|
||||
Gender = Masc | Fem | Neutr ;
|
||||
|
||||
lincat
|
||||
Spec = {s : Gender => Str ; n : Number} ;
|
||||
Noun = {s : Number => Str ; g : Gender} ;
|
||||
MAIN,NP = {s : Str} ;
|
||||
|
||||
lin
|
||||
Main np = np ;
|
||||
SpecNoun spec noun = {s = spec.s ! noun.g ++ noun.s ! spec.n} ;
|
||||
|
||||
One = {s = table {Fem => "eine" ; _ => "ein"} ; n = Sg} ;
|
||||
Two = {s = \\_ => "zwei" ; n = Pl} ;
|
||||
|
||||
Felis = mkNoun "Katze" "Katzen" Fem ;
|
||||
Canis = mkNoun "Hund" "Hünde" Masc ;
|
||||
|
||||
oper
|
||||
mkNoun : Str -> Str -> Gender -> {s : Number => Str ; g : Gender} = \s,p,g -> {
|
||||
s = table {
|
||||
Sg => s ;
|
||||
Pl => p
|
||||
} ;
|
||||
g = g
|
||||
} ;
|
||||
}
|
||||
39
examples/regulus/toy0/no-resource/Toy0_eng.gf
Normal file
39
examples/regulus/toy0/no-resource/Toy0_eng.gf
Normal file
@@ -0,0 +1,39 @@
|
||||
-- grammar from Chapter 2 of the Regulus book
|
||||
|
||||
flags startcat=MAIN ;
|
||||
|
||||
cat
|
||||
MAIN ; NP ; Noun ; Spec ;
|
||||
|
||||
fun
|
||||
Main : NP -> MAIN ;
|
||||
SpecNoun : Spec -> Noun -> NP ;
|
||||
|
||||
One, Two : Spec ;
|
||||
Felis, Canis : Noun ;
|
||||
|
||||
param
|
||||
Number = Sg | Pl ;
|
||||
|
||||
lincat
|
||||
Spec = {s : Str ; n : Number} ;
|
||||
Noun = {s : Number => Str} ;
|
||||
MAIN,NP = {s : Str} ;
|
||||
|
||||
lin
|
||||
Main np = np ;
|
||||
SpecNoun spec noun = {s = spec.s ++ noun.s ! spec.n} ;
|
||||
|
||||
One = {s = "one" ; n = Sg} ;
|
||||
Two = {s = "two" ; n = Pl} ;
|
||||
|
||||
Felis = regNoun "cat" ;
|
||||
Canis = regNoun "dog" ;
|
||||
|
||||
oper
|
||||
regNoun : Str -> {s : Number => Str} = \s -> {
|
||||
s = table {
|
||||
Sg => s ;
|
||||
Pl => s + "s"
|
||||
}
|
||||
} ;
|
||||
Reference in New Issue
Block a user