mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
getting started on Scots
This commit is contained in:
@@ -47,6 +47,7 @@ Slv,Slovenian,slovenian,,,,,n,n,,n,n
|
|||||||
Snd,Sindhi,sindhi,,,,,,,,y,n
|
Snd,Sindhi,sindhi,,,,,,,,y,n
|
||||||
Spa,Spanish,spanish,Romance,,y,,,,y,y,y
|
Spa,Spanish,spanish,Romance,,y,,,,y,y,y
|
||||||
Sqi,Albanian,albanian,,,,y,n,n,n,y,n
|
Sqi,Albanian,albanian,,,,y,n,n,n,y,n
|
||||||
|
Sco,Scots,scots,,,y,,,,,y,n
|
||||||
Swa,Swahili,swahili,Bantu,,,y,n,n,n,n,n
|
Swa,Swahili,swahili,Bantu,,,y,n,n,n,n,n
|
||||||
Swe,Swedish,swedish,Scand,,y,,,,y,y,y
|
Swe,Swedish,swedish,Scand,,y,,,,y,y,y
|
||||||
Tam,Tamil,tamil,n,n,n,n,n,n,n,n,n
|
Tam,Tamil,tamil,n,n,n,n,n,n,n,n,n
|
||||||
|
|||||||
|
15
src/api/CombinatorsSco.gf
Normal file
15
src/api/CombinatorsSco.gf
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
|
resource CombinatorsSco = Combinators - [ appCN, appCNc ] with
|
||||||
|
(Cat = CatSco),
|
||||||
|
(Structural = StructuralSco),
|
||||||
|
(Noun = NounSco),
|
||||||
|
(Constructors = ConstructorsSco) **
|
||||||
|
{
|
||||||
|
oper
|
||||||
|
appCN : CN -> NP -> NP
|
||||||
|
= \cn,x -> mkNP the_Art (PossNP cn x) ;
|
||||||
|
appCNc : CN -> [NP] -> NP
|
||||||
|
= \cn,xs -> let np : NP = mkNP and_Conj xs
|
||||||
|
in mkNP the_Art (PossNP cn np) ;
|
||||||
|
}
|
||||||
3
src/api/ConstructorsSco.gf
Normal file
3
src/api/ConstructorsSco.gf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
|
resource ConstructorsSco = Constructors with (Grammar = GrammarSco) ;
|
||||||
5
src/api/SymbolicSco.gf
Normal file
5
src/api/SymbolicSco.gf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
--# -path=.:../english:../common:../abstract:../prelude
|
||||||
|
|
||||||
|
resource SymbolicSco = Symbolic with
|
||||||
|
(Symbol = SymbolSco),
|
||||||
|
(Grammar = GrammarSco) ;
|
||||||
5
src/api/SyntaxSco.gf
Normal file
5
src/api/SyntaxSco.gf
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
--# -path=.:alltenses:prelude
|
||||||
|
|
||||||
|
instance SyntaxSco of Syntax =
|
||||||
|
ConstructorsSco, CatSco, StructuralSco, CombinatorsSco ;
|
||||||
|
|
||||||
22
src/api/TrySco.gf
Normal file
22
src/api/TrySco.gf
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
--# -path=.:../english:../common:../abstract:../prelude
|
||||||
|
|
||||||
|
resource TrySco = SyntaxSco-[mkAdN], LexiconSco, ParadigmsSco - [mkAdv,mkAdN,mkOrd,mkQuant,mkVoc] **
|
||||||
|
open (P = ParadigmsEng) in {
|
||||||
|
|
||||||
|
oper
|
||||||
|
|
||||||
|
mkAdv = overload SyntaxSco {
|
||||||
|
mkAdv : Str -> Adv = P.mkAdv ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkAdN = overload {
|
||||||
|
mkAdN : CAdv -> AdN = SyntaxSco.mkAdN ;
|
||||||
|
mkAdN : Str -> AdN = P.mkAdN ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mkOrd = overload SyntaxSco {
|
||||||
|
mkOrd : Str -> Ord = P.mkOrd ;
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
2
src/scots/AdjectiveSco.gf
Normal file
2
src/scots/AdjectiveSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete AdjectiveSco of Adjective = AdjectiveEng ** {
|
||||||
|
}
|
||||||
2
src/scots/AdverbSco.gf
Normal file
2
src/scots/AdverbSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete AdverbSco of Adverb = AdverbEng ** {
|
||||||
|
}
|
||||||
7
src/scots/AllSco.gf
Normal file
7
src/scots/AllSco.gf
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
--# -path=.:../abstract:../common:../api
|
||||||
|
|
||||||
|
concrete AllSco of AllScoAbs =
|
||||||
|
LangSco,
|
||||||
|
ExtendSco
|
||||||
|
**
|
||||||
|
{} ;
|
||||||
2
src/scots/CatSco.gf
Normal file
2
src/scots/CatSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete CatSco of Cat = CatEng ** {
|
||||||
|
}
|
||||||
2
src/scots/ConjunctionSco.gf
Normal file
2
src/scots/ConjunctionSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete ConjunctionSco of Conjunction = ConjunctionEng ** {
|
||||||
|
}
|
||||||
2
src/scots/ConstructionSco.gf
Normal file
2
src/scots/ConstructionSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete ConstructionSco of Construction = ConstructionEng ** {
|
||||||
|
}
|
||||||
3
src/scots/DocumentationSco.gf
Normal file
3
src/scots/DocumentationSco.gf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
--# -path=.:../abstract:../common
|
||||||
|
concrete DocumentationSco of Documentation = DocumentationEng ** {
|
||||||
|
}
|
||||||
4
src/scots/ExtendSco.gf
Normal file
4
src/scots/ExtendSco.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
--# -path=.:../common:../abstract
|
||||||
|
|
||||||
|
concrete ExtendSco of Extend = ExtendEng ** {
|
||||||
|
}
|
||||||
28
src/scots/GrammarSco.gf
Normal file
28
src/scots/GrammarSco.gf
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
--# -path=.:../abstract:../common:prelude
|
||||||
|
|
||||||
|
concrete GrammarSco of Grammar =
|
||||||
|
NounSco,
|
||||||
|
VerbSco,
|
||||||
|
AdjectiveSco,
|
||||||
|
AdverbSco,
|
||||||
|
NumeralSco,
|
||||||
|
SentenceSco,
|
||||||
|
QuestionSco,
|
||||||
|
RelativeSco,
|
||||||
|
ConjunctionSco,
|
||||||
|
PhraseSco,
|
||||||
|
TextX - [Pol,PPos,PNeg,SC,CAdv],
|
||||||
|
StructuralSco,
|
||||||
|
IdiomSco,
|
||||||
|
TenseX - [Pol,PPos,PNeg,SC,CAdv],
|
||||||
|
NamesSco
|
||||||
|
** open ResSco, Prelude in {
|
||||||
|
|
||||||
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
PPos = {s = [] ; p = CPos} ;
|
||||||
|
PNeg = {s = [] ; p = CNeg True} ; -- contracted: don't
|
||||||
|
|
||||||
|
|
||||||
|
} ;
|
||||||
2
src/scots/IdiomSco.gf
Normal file
2
src/scots/IdiomSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete IdiomSco of Idiom = IdiomEng ** {
|
||||||
|
}
|
||||||
10
src/scots/LangSco.gf
Normal file
10
src/scots/LangSco.gf
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
--# -path=.:../abstract:../common:../api:../prelude
|
||||||
|
|
||||||
|
concrete LangSco of Lang =
|
||||||
|
GrammarSco,
|
||||||
|
LexiconSco
|
||||||
|
,ConstructionSco
|
||||||
|
,DocumentationSco --# notpresent
|
||||||
|
** {
|
||||||
|
|
||||||
|
} ;
|
||||||
2
src/scots/LexiconSco.gf
Normal file
2
src/scots/LexiconSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete LexiconSco of Lexicon = LexiconEng ** open ParadigmsSco in {
|
||||||
|
} ;
|
||||||
2
src/scots/NamesSco.gf
Normal file
2
src/scots/NamesSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete NamesSco of Names = NamesEng ** {
|
||||||
|
}
|
||||||
16
src/scots/NounSco.gf
Normal file
16
src/scots/NounSco.gf
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
concrete NounSco of Noun = NounEng - [IndefArt] ** open Prelude, ResSco in {
|
||||||
|
|
||||||
|
lin IndefArt = {
|
||||||
|
s = \\hasCard,n => case <n,hasCard> of {
|
||||||
|
<Sg,False> => "a" ;
|
||||||
|
_ => []
|
||||||
|
} ;
|
||||||
|
sp = \\g,hasCard,n => case <n,hasCard> of {
|
||||||
|
<Sg,False> => table {NCase Gen => "ane's"; _ => "ane" };
|
||||||
|
<Pl,False> => table {NCase Gen => "anes'"; _ => "anes" } ;
|
||||||
|
_ => \\c => []
|
||||||
|
} ;
|
||||||
|
isDef = False
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
156
src/scots/NumeralSco.gf
Normal file
156
src/scots/NumeralSco.gf
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
concrete NumeralSco of Numeral = CatSco [Numeral,Digits,Decimal] ** open Prelude, ResSco in {
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Digit = {s : DForm => CardOrd => Case => Str} ;
|
||||||
|
Sub10 = {s : DForm => CardOrd => Case => Str ; n : Number} ;
|
||||||
|
Sub100 = {s : CardOrd => Case => Str ; n : Number} ;
|
||||||
|
Sub1000 = {s : Bool => CardOrd => Case => Str ; n : Number} ;
|
||||||
|
Sub1000000 = {s : Bool => CardOrd => Case => Str ; n : Number} ;
|
||||||
|
Sub1000000000 = {s : Bool => CardOrd => Case => Str ; n : Number} ;
|
||||||
|
Sub1000000000000 = {s : Bool => CardOrd => Case => Str ; n : Number} ;
|
||||||
|
|
||||||
|
lin num x = x ;
|
||||||
|
lin n2 = let two = mkNum "twa" "twal" "twintie" "saicont" in
|
||||||
|
{s = \\f,o => case <f,o> of {
|
||||||
|
<teen,NOrd> => regGenitiveS "twalt" ;
|
||||||
|
_ => two.s ! f ! o
|
||||||
|
}
|
||||||
|
} ;
|
||||||
|
|
||||||
|
lin n3 = mkNum "three" "thirteen" "thirty" "third" ;
|
||||||
|
lin n4 = mkNum "fower" "fourteen" "fourtie" "fourth" ;
|
||||||
|
lin n5 = mkNum "five" "fifteen" "fifty" "fifth" ;
|
||||||
|
lin n6 = regNum "sax" ;
|
||||||
|
lin n7 = regNum "seiven" ;
|
||||||
|
lin n8 = mkNum "echt" "echteen" "echtie" "echt" ;
|
||||||
|
lin n9 = mkNum "nine" "nineteen" "ninetie" "nint" ;
|
||||||
|
|
||||||
|
lin pot01 = mkNum "ane" "eleivin" "ten" "first" ** {n = Sg} ;
|
||||||
|
lin pot0 d = d ** {n = Pl} ;
|
||||||
|
lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ;
|
||||||
|
|
||||||
|
lin pot110 = regCardOrd "ten" ** {n = Pl} ;
|
||||||
|
lin pot111 = regCardOrd "eleven" ** {n = Pl} ;
|
||||||
|
lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ;
|
||||||
|
lin pot1 d = {s = d.s ! ten} ** {n = Pl} ;
|
||||||
|
lin pot1plus d e = {
|
||||||
|
s = \\o,c => d.s ! ten ! NCard ! Nom ++ BIND ++ "-" ++ BIND ++ e.s ! unit ! o ! c ; n = Pl} ;
|
||||||
|
lin pot1as2 n = {s = \\_ => n.s; n=n.n} ;
|
||||||
|
|
||||||
|
lin pot21 = {
|
||||||
|
s = \\d,o,c => case d of {True => []; False => "a"} ++
|
||||||
|
(regCardOrd "hunner").s ! o ! c;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
lin pot2 d = {s = \\_,o,c => d.s ! unit ! NCard ! Nom ++ mkCard o "hundred" ! c} ** {n = Pl} ;
|
||||||
|
lin pot2plus d e = {
|
||||||
|
s = \\_,o,c => d.s ! unit ! NCard ! Nom ++ "hundred" ++ "and" ++ e.s ! o ! c ; n = Pl} ;
|
||||||
|
lin pot2as3 n = n ;
|
||||||
|
|
||||||
|
lin pot31 = {
|
||||||
|
s = \\d,o,c => case d of {True => []; False => "a"} ++
|
||||||
|
(regCardOrd "thousand").s ! o ! c;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
lin pot3 n = {
|
||||||
|
s = \\d,o,c => n.s ! d ! NCard ! Nom ++ mkCard o "thoosand" ! c ; n = Pl} ;
|
||||||
|
lin pot3plus n m = {
|
||||||
|
s = \\d,o,c => n.s ! d ! NCard ! Nom ++ "thoosand" ++ m.s ! False ! o ! c; n = Pl} ;
|
||||||
|
lin pot3as4 n = n ;
|
||||||
|
lin pot3decimal f = {
|
||||||
|
s = \\d,o,c => f.s ! NCard ! Nom ++ mkCard o "thoosand" ! c ; n = Pl} ;
|
||||||
|
|
||||||
|
lin pot41 = {
|
||||||
|
s = \\d,o,c => case d of {True => []; False => "a"} ++
|
||||||
|
(regCardOrd "million").s ! o ! c;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
lin pot4 n = {
|
||||||
|
s = \\d,o,c => n.s ! d ! NCard ! Nom ++ pot41.s ! True ! o ! c ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
lin pot4plus n1 n2 = {
|
||||||
|
s = \\d,o,c => n1.s ! d ! NCard ! Nom ++ pot41.s ! True ! NCard ! Nom ++ "and" ++ n2.s ! True ! o ! c;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
lin pot4as5 n = n ;
|
||||||
|
lin pot4decimal f = {
|
||||||
|
s = \\d,o,c => f.s ! NCard ! Nom ++ pot41.s ! True ! o ! c ; n = Pl} ;
|
||||||
|
|
||||||
|
lin pot51 = {
|
||||||
|
s = \\d,o,c => case d of {True => []; False => "a"} ++
|
||||||
|
(regCardOrd "billion").s ! o ! c;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
lin pot5 n = {
|
||||||
|
s = \\d,o,c => n.s ! d ! NCard ! Nom ++ pot51.s ! True ! o ! c ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
lin pot5plus n1 n2 = {
|
||||||
|
s = \\d,o,c => n1.s ! d ! NCard ! Nom ++ pot51.s ! True ! NCard ! Nom ++ "and" ++ n2.s ! True ! o ! c;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
lin pot5decimal f = {
|
||||||
|
s = \\d,o,c => f.s ! NCard ! Nom ++ pot51.s ! True ! o ! c ; n = Pl} ;
|
||||||
|
|
||||||
|
-- numerals as sequences of digits
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Dig = TDigit ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
IDig d = d ** {tail = T1} ;
|
||||||
|
|
||||||
|
IIDig d i = {
|
||||||
|
s = \\o,c => d.s ! NCard ! Nom ++ commaIf i.tail ++ i.s ! o ! c ;
|
||||||
|
n = Pl ;
|
||||||
|
tail = inc i.tail
|
||||||
|
} ;
|
||||||
|
|
||||||
|
D_0 = mkDig "0" ;
|
||||||
|
D_1 = mk3Dig "1" "1st" Sg ;
|
||||||
|
D_2 = mk2Dig "2" "2nd" ;
|
||||||
|
D_3 = mk2Dig "3" "3rd" ;
|
||||||
|
D_4 = mkDig "4" ;
|
||||||
|
D_5 = mkDig "5" ;
|
||||||
|
D_6 = mkDig "6" ;
|
||||||
|
D_7 = mkDig "7" ;
|
||||||
|
D_8 = mkDig "8" ;
|
||||||
|
D_9 = mkDig "9" ;
|
||||||
|
|
||||||
|
lin PosDecimal d = d ** {hasDot=False} ;
|
||||||
|
NegDecimal d = {s=\\o,c=>"-" ++ BIND ++ d.s ! o ! c; hasDot=False; n = Pl} ;
|
||||||
|
IFrac d i = {
|
||||||
|
s=\\o,c=>d.s ! NCard ! Nom ++
|
||||||
|
if_then_Str d.hasDot BIND (BIND++"."++BIND) ++
|
||||||
|
i.s ! o ! c ;
|
||||||
|
hasDot=True;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
|
||||||
|
oper
|
||||||
|
commaIf : DTail -> Str = \t -> case t of {
|
||||||
|
T3 => BIND ++ "," ++ BIND ;
|
||||||
|
_ => BIND
|
||||||
|
} ;
|
||||||
|
|
||||||
|
inc : DTail -> DTail = \t -> case t of {
|
||||||
|
T1 => T2 ;
|
||||||
|
T2 => T3 ;
|
||||||
|
T3 => T1
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ;
|
||||||
|
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "th") ;
|
||||||
|
|
||||||
|
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||||
|
s = table {NCard => regGenitiveS c ; NOrd => regGenitiveS o} ;
|
||||||
|
n = n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
TDigit = {
|
||||||
|
n : Number ;
|
||||||
|
s : CardOrd => Case => Str
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
2
src/scots/ParadigmsSco.gf
Normal file
2
src/scots/ParadigmsSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
resource ParadigmsSco = ParadigmsEng ** {
|
||||||
|
} ;
|
||||||
2
src/scots/PhraseSco.gf
Normal file
2
src/scots/PhraseSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete PhraseSco of Phrase = PhraseEng ** {
|
||||||
|
}
|
||||||
2
src/scots/QuestionSco.gf
Normal file
2
src/scots/QuestionSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete QuestionSco of Question = QuestionEng ** {
|
||||||
|
}
|
||||||
2
src/scots/RelativeSco.gf
Normal file
2
src/scots/RelativeSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete RelativeSco of Relative = RelativeEng ** {
|
||||||
|
}
|
||||||
2
src/scots/ResSco.gf
Normal file
2
src/scots/ResSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
resource ResSco = ResEng ** {
|
||||||
|
}
|
||||||
3
src/scots/SentenceSco.gf
Normal file
3
src/scots/SentenceSco.gf
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
concrete SentenceSco of Sentence = SentenceEng ** {
|
||||||
|
}
|
||||||
|
|
||||||
2
src/scots/StructuralSco.gf
Normal file
2
src/scots/StructuralSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete StructuralSco of Structural = StructuralEng ** {
|
||||||
|
}
|
||||||
2
src/scots/SymbolSco.gf
Normal file
2
src/scots/SymbolSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete SymbolSco of Symbol = SymbolEng ** {
|
||||||
|
}
|
||||||
2
src/scots/VerbSco.gf
Normal file
2
src/scots/VerbSco.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete VerbSco of Verb = VerbEng ** {
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user