diff --git a/languages.csv b/languages.csv index bfd38d977..efedbac3e 100644 --- a/languages.csv +++ b/languages.csv @@ -47,6 +47,7 @@ Slv,Slovenian,slovenian,,,,,n,n,,n,n Snd,Sindhi,sindhi,,,,,,,,y,n Spa,Spanish,spanish,Romance,,y,,,,y,y,y 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 Swe,Swedish,swedish,Scand,,y,,,,y,y,y Tam,Tamil,tamil,n,n,n,n,n,n,n,n,n diff --git a/src/api/CombinatorsSco.gf b/src/api/CombinatorsSco.gf new file mode 100644 index 000000000..e58574364 --- /dev/null +++ b/src/api/CombinatorsSco.gf @@ -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) ; + } diff --git a/src/api/ConstructorsSco.gf b/src/api/ConstructorsSco.gf new file mode 100644 index 000000000..7f7310d51 --- /dev/null +++ b/src/api/ConstructorsSco.gf @@ -0,0 +1,3 @@ +--# -path=.:alltenses:prelude + +resource ConstructorsSco = Constructors with (Grammar = GrammarSco) ; diff --git a/src/api/SymbolicSco.gf b/src/api/SymbolicSco.gf new file mode 100644 index 000000000..4a001888d --- /dev/null +++ b/src/api/SymbolicSco.gf @@ -0,0 +1,5 @@ +--# -path=.:../english:../common:../abstract:../prelude + +resource SymbolicSco = Symbolic with + (Symbol = SymbolSco), + (Grammar = GrammarSco) ; diff --git a/src/api/SyntaxSco.gf b/src/api/SyntaxSco.gf new file mode 100644 index 000000000..544498f6e --- /dev/null +++ b/src/api/SyntaxSco.gf @@ -0,0 +1,5 @@ +--# -path=.:alltenses:prelude + +instance SyntaxSco of Syntax = + ConstructorsSco, CatSco, StructuralSco, CombinatorsSco ; + diff --git a/src/api/TrySco.gf b/src/api/TrySco.gf new file mode 100644 index 000000000..ece8cc00f --- /dev/null +++ b/src/api/TrySco.gf @@ -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 ; + } ; + + +} diff --git a/src/scots/AdjectiveSco.gf b/src/scots/AdjectiveSco.gf new file mode 100644 index 000000000..308931f02 --- /dev/null +++ b/src/scots/AdjectiveSco.gf @@ -0,0 +1,2 @@ +concrete AdjectiveSco of Adjective = AdjectiveEng ** { +} diff --git a/src/scots/AdverbSco.gf b/src/scots/AdverbSco.gf new file mode 100644 index 000000000..b189b044a --- /dev/null +++ b/src/scots/AdverbSco.gf @@ -0,0 +1,2 @@ +concrete AdverbSco of Adverb = AdverbEng ** { +} diff --git a/src/scots/AllSco.gf b/src/scots/AllSco.gf new file mode 100644 index 000000000..ff87d024e --- /dev/null +++ b/src/scots/AllSco.gf @@ -0,0 +1,7 @@ +--# -path=.:../abstract:../common:../api + +concrete AllSco of AllScoAbs = + LangSco, + ExtendSco + ** + {} ; diff --git a/src/scots/CatSco.gf b/src/scots/CatSco.gf new file mode 100644 index 000000000..989d7c204 --- /dev/null +++ b/src/scots/CatSco.gf @@ -0,0 +1,2 @@ +concrete CatSco of Cat = CatEng ** { +} diff --git a/src/scots/ConjunctionSco.gf b/src/scots/ConjunctionSco.gf new file mode 100644 index 000000000..c93effa50 --- /dev/null +++ b/src/scots/ConjunctionSco.gf @@ -0,0 +1,2 @@ +concrete ConjunctionSco of Conjunction = ConjunctionEng ** { +} diff --git a/src/scots/ConstructionSco.gf b/src/scots/ConstructionSco.gf new file mode 100644 index 000000000..2c74072dc --- /dev/null +++ b/src/scots/ConstructionSco.gf @@ -0,0 +1,2 @@ +concrete ConstructionSco of Construction = ConstructionEng ** { +} diff --git a/src/scots/DocumentationSco.gf b/src/scots/DocumentationSco.gf new file mode 100644 index 000000000..587d67e6d --- /dev/null +++ b/src/scots/DocumentationSco.gf @@ -0,0 +1,3 @@ +--# -path=.:../abstract:../common +concrete DocumentationSco of Documentation = DocumentationEng ** { +} diff --git a/src/scots/ExtendSco.gf b/src/scots/ExtendSco.gf new file mode 100644 index 000000000..f14d4508a --- /dev/null +++ b/src/scots/ExtendSco.gf @@ -0,0 +1,4 @@ +--# -path=.:../common:../abstract + +concrete ExtendSco of Extend = ExtendEng ** { +} diff --git a/src/scots/GrammarSco.gf b/src/scots/GrammarSco.gf new file mode 100644 index 000000000..f7a1fd7a6 --- /dev/null +++ b/src/scots/GrammarSco.gf @@ -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 + + +} ; diff --git a/src/scots/IdiomSco.gf b/src/scots/IdiomSco.gf new file mode 100644 index 000000000..3fc95353a --- /dev/null +++ b/src/scots/IdiomSco.gf @@ -0,0 +1,2 @@ +concrete IdiomSco of Idiom = IdiomEng ** { +} diff --git a/src/scots/LangSco.gf b/src/scots/LangSco.gf new file mode 100644 index 000000000..84940c22a --- /dev/null +++ b/src/scots/LangSco.gf @@ -0,0 +1,10 @@ +--# -path=.:../abstract:../common:../api:../prelude + +concrete LangSco of Lang = + GrammarSco, + LexiconSco + ,ConstructionSco + ,DocumentationSco --# notpresent + ** { + +} ; diff --git a/src/scots/LexiconSco.gf b/src/scots/LexiconSco.gf new file mode 100644 index 000000000..54967d395 --- /dev/null +++ b/src/scots/LexiconSco.gf @@ -0,0 +1,2 @@ +concrete LexiconSco of Lexicon = LexiconEng ** open ParadigmsSco in { +} ; diff --git a/src/scots/NamesSco.gf b/src/scots/NamesSco.gf new file mode 100644 index 000000000..a8da6f008 --- /dev/null +++ b/src/scots/NamesSco.gf @@ -0,0 +1,2 @@ +concrete NamesSco of Names = NamesEng ** { +} diff --git a/src/scots/NounSco.gf b/src/scots/NounSco.gf new file mode 100644 index 000000000..30c8fc50d --- /dev/null +++ b/src/scots/NounSco.gf @@ -0,0 +1,16 @@ +concrete NounSco of Noun = NounEng - [IndefArt] ** open Prelude, ResSco in { + +lin IndefArt = { + s = \\hasCard,n => case of { + => "a" ; + _ => [] + } ; + sp = \\g,hasCard,n => case of { + => table {NCase Gen => "ane's"; _ => "ane" }; + => table {NCase Gen => "anes'"; _ => "anes" } ; + _ => \\c => [] + } ; + isDef = False + } ; + +} diff --git a/src/scots/NumeralSco.gf b/src/scots/NumeralSco.gf new file mode 100644 index 000000000..4e8a325a0 --- /dev/null +++ b/src/scots/NumeralSco.gf @@ -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 of { + => 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 + } ; + +} diff --git a/src/scots/ParadigmsSco.gf b/src/scots/ParadigmsSco.gf new file mode 100644 index 000000000..1a468757e --- /dev/null +++ b/src/scots/ParadigmsSco.gf @@ -0,0 +1,2 @@ +resource ParadigmsSco = ParadigmsEng ** { +} ; diff --git a/src/scots/PhraseSco.gf b/src/scots/PhraseSco.gf new file mode 100644 index 000000000..990b25358 --- /dev/null +++ b/src/scots/PhraseSco.gf @@ -0,0 +1,2 @@ +concrete PhraseSco of Phrase = PhraseEng ** { +} diff --git a/src/scots/QuestionSco.gf b/src/scots/QuestionSco.gf new file mode 100644 index 000000000..e936f1757 --- /dev/null +++ b/src/scots/QuestionSco.gf @@ -0,0 +1,2 @@ +concrete QuestionSco of Question = QuestionEng ** { +} diff --git a/src/scots/RelativeSco.gf b/src/scots/RelativeSco.gf new file mode 100644 index 000000000..b17ae3c7d --- /dev/null +++ b/src/scots/RelativeSco.gf @@ -0,0 +1,2 @@ +concrete RelativeSco of Relative = RelativeEng ** { +} diff --git a/src/scots/ResSco.gf b/src/scots/ResSco.gf new file mode 100644 index 000000000..8c2241b83 --- /dev/null +++ b/src/scots/ResSco.gf @@ -0,0 +1,2 @@ +resource ResSco = ResEng ** { +} diff --git a/src/scots/SentenceSco.gf b/src/scots/SentenceSco.gf new file mode 100644 index 000000000..2dc98c1d9 --- /dev/null +++ b/src/scots/SentenceSco.gf @@ -0,0 +1,3 @@ +concrete SentenceSco of Sentence = SentenceEng ** { +} + diff --git a/src/scots/StructuralSco.gf b/src/scots/StructuralSco.gf new file mode 100644 index 000000000..f07db777a --- /dev/null +++ b/src/scots/StructuralSco.gf @@ -0,0 +1,2 @@ +concrete StructuralSco of Structural = StructuralEng ** { +} diff --git a/src/scots/SymbolSco.gf b/src/scots/SymbolSco.gf new file mode 100644 index 000000000..680633624 --- /dev/null +++ b/src/scots/SymbolSco.gf @@ -0,0 +1,2 @@ +concrete SymbolSco of Symbol = SymbolEng ** { +} diff --git a/src/scots/VerbSco.gf b/src/scots/VerbSco.gf new file mode 100644 index 000000000..af1d28f67 --- /dev/null +++ b/src/scots/VerbSco.gf @@ -0,0 +1,2 @@ +concrete VerbSco of Verb = VerbEng ** { +}