1
0
forked from GitHub/gf-core

changed names of resource-1.3; added a note on homepage on release

This commit is contained in:
aarne
2008-06-25 16:54:35 +00:00
parent b96b36f43d
commit e9e80fc389
903 changed files with 113 additions and 32 deletions

View File

@@ -0,0 +1,15 @@
-- toy0 grammar from Chapter 2 of the Regulus book
abstract Toy0 = {
flags startcat=NP ;
cat
NP ;
Noun ;
Spec ;
fun
SpecNoun : Spec -> Noun -> NP ;
One, Two : Spec ;
Felis, Canis : Noun ;
}

View File

@@ -0,0 +1,5 @@
--# -path=.:present:prelude
concrete Toy0Eng of Toy0 = Toy0I with
(Syntax = SyntaxEng),
(Lexicon = LexiconEng) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:prelude
concrete Toy0Fin of Toy0 = Toy0I with
(Syntax = SyntaxFin),
(Lexicon = LexiconFin) ;

View File

@@ -0,0 +1,5 @@
--# -path=.:present:prelude
concrete Toy0Fre of Toy0 = Toy0I with
(Syntax = SyntaxFre),
(Lexicon = LexiconFre) ;

View File

@@ -0,0 +1,18 @@
incomplete concrete Toy0I of Toy0 = open Syntax, Lexicon in {
lincat
Spec = Det ;
Noun = N ;
NP = Utt ;
lin
SpecNoun spec noun = mkUtt (mkNP spec noun) ;
One = mkDet n1_Numeral ;
Two = mkDet n2_Numeral ;
Felis = cat_N ;
Canis = dog_N ;
}

View File

@@ -0,0 +1,5 @@
--# -path=.:present:prelude
concrete Toy0Swe of Toy0 = Toy0I with
(Syntax = SyntaxSwe),
(Lexicon = LexiconSwe) ;

View File

@@ -0,0 +1,15 @@
-- toy0 grammar from Chapter 2 of the Regulus book
abstract Toy0 = {
flags startcat=NP ;
cat
NP ;
Noun ;
Spec ;
fun
SpecNoun : Spec -> Noun -> NP ;
One, Two : Spec ;
Felis, Canis : Noun ;
}

View File

@@ -0,0 +1,6 @@
--# -path=.:present:prelude
concrete Toy0Ger of Toy0 = Toy0I with
(Grammar = GrammarGer),
(Lexicon = LexiconGer) ;

View File

@@ -0,0 +1,23 @@
--# -resource=present/LangEng.gfc
--# -path=.:present:prelude
-- to compile: gf -examples Toy0I.gfe
incomplete concrete Toy0I of Toy0 = open Grammar, Lexicon in {
lincat
Spec = Det ;
Noun = N ;
NP = Utt ;
lin
SpecNoun every_Det house_N = in Utt "every house" ;
One = in Det "one" ;
Two = in Det "two" ;
Felis = in N "cat" ;
Canis = in N "dog" ;
}

View File

@@ -0,0 +1,15 @@
-- toy0 grammar from Chapter 2 of the Regulus book
abstract Toy0 = {
flags startcat=NP ;
cat
NP ;
Noun ;
Spec ;
fun
SpecNoun : Spec -> Noun -> NP ;
One, Two : Spec ;
Felis, Canis : Noun ;
}

View File

@@ -0,0 +1,16 @@
--# -path=.:present:api:prelude
concrete Toy0Eng of Toy0 =
open SyntaxEng, ParadigmsEng in {
flags language=en_US ;
lincat
Spec = Det ; Noun = N ; NP = Utt ;
lin
SpecNoun s n = mkUtt (mkNP s n) ;
One = mkDet one_Quant ;
Two = mkDet n2_Numeral ;
Felis = mkN "cat" ;
Canis = mkN "dog" ;
}

View File

@@ -0,0 +1,16 @@
--# -path=.:present:prelude
concrete Toy0Fin of Toy0 = open SyntaxFin, ParadigmsFin in {
lincat
Spec = Det ;
Noun = N ;
NP = Utt ;
lin
SpecNoun spec noun = mkUtt (SyntaxFin.mkNP spec noun) ;
One = mkDet one_Quant ;
Two = mkDet (mkNum n2_Numeral) ;
Felis = mkN "kissa" ;
Canis = mkN "koira" ;
}

View File

@@ -0,0 +1,15 @@
-- toy0 grammar from Chapter 2 of the Regulus book
abstract Toy0 = {
flags startcat=NP ;
cat
NP ;
Noun ;
Spec ;
fun
SpecNoun : Spec -> Noun -> NP ;
One, Two : Spec ;
Felis, Canis : Noun ;
}

View File

@@ -0,0 +1,27 @@
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"
}
} ;
}

View File

@@ -0,0 +1,29 @@
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
} ;
}

View File

@@ -0,0 +1,29 @@
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} ;
NP = {s : Str} ;
lin
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
} ;
}

View 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"
}
} ;

View File

@@ -0,0 +1 @@
--# prob Felis 0.9