diff --git a/lib/resource-1.0/mathematical/Mathematical.gf b/lib/resource-1.0/mathematical/Mathematical.gf new file mode 100644 index 000000000..65afef3b1 --- /dev/null +++ b/lib/resource-1.0/mathematical/Mathematical.gf @@ -0,0 +1,31 @@ +--1 The Mathematics API to the Resource Grammar + +-- This grammar is a collection of the different modules. +-- It differs from $Lang$ in two main ways: +-- - the combinations in Noun, Verb, Adjective, Adverb, Sentence are not included +-- - instead, Symbol and Predication are used +-- +-- +-- In practice, the most important difference is that only present-tense sentences +-- are included, and that symbolic expressions are recognized as NPs. + +abstract Mathematical = + Noun - [ComplN2], --- to avoid ambiguity +-- Verb, + Adjective, + Adverb, + Numeral, +-- Sentence, + Question, + Relative, + Conjunction, + Phrase, + Text, + Idiom, + Structural, + + Symbol, + Predication, + + Lexicon + ** {} ; diff --git a/lib/resource-1.0/mathematical/MathematicalEng.gf b/lib/resource-1.0/mathematical/MathematicalEng.gf new file mode 100644 index 000000000..9042a3eb9 --- /dev/null +++ b/lib/resource-1.0/mathematical/MathematicalEng.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalEng of Mathematical = + NounEng - [ComplN2], --- to avoid ambiguity +-- VerbEng, + AdjectiveEng, + AdverbEng, + NumeralEng, +-- SentenceEng, + QuestionEng, + RelativeEng, + ConjunctionEng, + PhraseEng, + StructuralEng, + TextX, + IdiomEng, + + SymbolEng, + PredicationEng, + + LexiconEng + ** { + +flags startcat = Phr ; + +} ; diff --git a/lib/resource-1.0/mathematical/MathematicalFin.gf b/lib/resource-1.0/mathematical/MathematicalFin.gf new file mode 100644 index 000000000..26704d6e3 --- /dev/null +++ b/lib/resource-1.0/mathematical/MathematicalFin.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalFin of Mathematical = + NounFin - [ComplN2], --- to avoid ambiguity +-- VerbFin, + AdjectiveFin, + AdverbFin, + NumeralFin, +-- SentenceFin, + QuestionFin, + RelativeFin, + ConjunctionFin, + PhraseFin, + TextX, + IdiomFin, + StructuralFin, + + SymbolFin, + PredicationFin, + + LexiconFin + ** { + +flags startcat = Phr ; + +} ; diff --git a/lib/resource-1.0/mathematical/MathematicalFre.gf b/lib/resource-1.0/mathematical/MathematicalFre.gf new file mode 100644 index 000000000..006422322 --- /dev/null +++ b/lib/resource-1.0/mathematical/MathematicalFre.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalFre of Mathematical = + NounFre - [ComplN2], --- to avoid ambiguity +-- VerbFre, + AdjectiveFre, + AdverbFre, + NumeralFre, +-- SentenceFre, + QuestionFre, + RelativeFre, + ConjunctionFre, + PhraseFre, + TextX, + IdiomFre, + StructuralFre, + + SymbolFre, + PredicationFre - [predV3], ---- gf bug + + LexiconFre + ** { + +flags startcat = Phr ; + +} ; diff --git a/lib/resource-1.0/mathematical/MathematicalGer.gf b/lib/resource-1.0/mathematical/MathematicalGer.gf new file mode 100644 index 000000000..79f5e39ee --- /dev/null +++ b/lib/resource-1.0/mathematical/MathematicalGer.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalGer of Mathematical = + NounGer - [ComplN2], --- to avoid ambiguity +-- VerbGer, + AdjectiveGer, + AdverbGer, + NumeralGer, +-- SentenceGer, + QuestionGer, + RelativeGer, + ConjunctionGer, + PhraseGer, + TextX, + IdiomGer, + StructuralGer, + + SymbolGer, + PredicationGer, + + LexiconGer + ** { + +flags startcat = Phr ; + +} ; diff --git a/lib/resource-1.0/mathematical/MathematicalIta.gf b/lib/resource-1.0/mathematical/MathematicalIta.gf new file mode 100644 index 000000000..efdec3bbd --- /dev/null +++ b/lib/resource-1.0/mathematical/MathematicalIta.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalIta of Mathematical = + NounIta - [ComplN2], --- to avoid ambiguity +-- VerbIta, + AdjectiveIta, + AdverbIta, + NumeralIta, +-- SentenceIta, + QuestionIta, + RelativeIta, + ConjunctionIta, + PhraseIta, + TextX, + IdiomIta, + StructuralIta, + + SymbolIta, + PredicationIta, -- - [predV3,predV2], --- gf bug + + LexiconIta + ** { + +flags startcat = Phr ; + +} ; diff --git a/lib/resource-1.0/mathematical/MathematicalNor.gf b/lib/resource-1.0/mathematical/MathematicalNor.gf new file mode 100644 index 000000000..383ced6eb --- /dev/null +++ b/lib/resource-1.0/mathematical/MathematicalNor.gf @@ -0,0 +1,27 @@ +--# -path=.:present:prelude + +concrete MathematicalNor of Mathematical = + NounNor - [ComplN2], --- to avoid ambiguity +-- VerbNor, + AdjectiveNor, + AdverbNor, + NumeralNor, +-- SentenceNor, + QuestionNor, + RelativeNor, + ConjunctionNor, + PhraseNor, + TextX, + IdiomNor, + + StructuralNor, + + SymbolNor, + PredicationNor, + + LexiconNor + ** { + +flags startcat = Phr ; + +} ; diff --git a/lib/resource-1.0/mathematical/MathematicalSpa.gf b/lib/resource-1.0/mathematical/MathematicalSpa.gf new file mode 100644 index 000000000..059e1cb4b --- /dev/null +++ b/lib/resource-1.0/mathematical/MathematicalSpa.gf @@ -0,0 +1,26 @@ +--# -path=.:present:prelude + +concrete MathematicalSpa of Mathematical = + NounSpa - [ComplN2], --- to avoid ambiguity +-- VerbSpa, + AdjectiveSpa, + AdverbSpa, + NumeralSpa, +-- SentenceSpa, + QuestionSpa, + RelativeSpa, + ConjunctionSpa, + PhraseSpa, + TextSpa, + IdiomSpa, + StructuralSpa, + + SymbolSpa, + PredicationSpa, -- - [predV3,predV2], --- gf bug + + LexiconSpa + ** { + +flags startcat = Phr ; + +} ; diff --git a/lib/resource-1.0/mathematical/MathematicalSwe.gf b/lib/resource-1.0/mathematical/MathematicalSwe.gf new file mode 100644 index 000000000..59d5fefde --- /dev/null +++ b/lib/resource-1.0/mathematical/MathematicalSwe.gf @@ -0,0 +1,27 @@ +--# -path=.:present:prelude + +concrete MathematicalSwe of Mathematical = + NounSwe - [ComplN2], --- to avoid ambiguity +-- VerbSwe, + AdjectiveSwe, + AdverbSwe, + NumeralSwe, +-- SentenceSwe, + QuestionSwe, + RelativeSwe, + ConjunctionSwe, + PhraseSwe, + TextX, + IdiomSwe, + + StructuralSwe, + + SymbolSwe, + PredicationSwe, + + LexiconSwe + ** { + +flags startcat = Phr ; + +} ; diff --git a/lib/resource-1.0/mathematical/Predication.gf b/lib/resource-1.0/mathematical/Predication.gf new file mode 100644 index 000000000..f53d44005 --- /dev/null +++ b/lib/resource-1.0/mathematical/Predication.gf @@ -0,0 +1,60 @@ +--1 A Small Predication Library +-- +-- (c) Aarne Ranta 2003-2006 under Gnu GPL. +-- +-- This library is a derived library built on the language-independent Ground +-- API of resource grammars. + +abstract Predication = Cat ** { + +--2 The category of atomic sentences + +-- We want to use sentences in positive and negative forms but do not care about +-- tenses. + +fun + PosCl : Cl -> S ; -- positive sentence: "x intersects y" + NegCl : Cl -> S ; -- negative sentence: "x doesn't intersect y" + +--2 Predication patterns. + + predV : V -> NP -> Cl ; -- one-place verb: "x converges" + predV2 : V2 -> NP -> NP -> Cl ; -- two-place verb: "x intersects y" + predV3 : V3 -> NP->NP-> NP -> Cl; -- three-place verb: "x intersects y at z" + predVColl : V -> NP -> NP -> Cl ; -- collective verb: "x and y intersect" + predA : A -> NP -> Cl ; -- one-place adjective: "x is even" + predA2 : A2 -> NP -> NP -> Cl ; -- two-place adj: "x is divisible by y" + predAComp : A -> NP -> NP -> Cl; -- comparative adj: "x is greater than y" + predAColl : A -> NP -> NP -> Cl ; -- collective adj: "x and y are parallel" + predN : N -> NP -> Cl ; -- one-place noun: "x is a point" + predN2 : N2 -> NP -> NP -> Cl ; -- two-place noun: "x is a divisor of y" + predNColl : N -> NP -> NP -> Cl ; -- collective noun: "x and y are duals" + predAdv : Adv -> NP -> Cl ; -- adverb: "x is inside" + predPrep : Prep -> NP -> NP -> Cl ; -- preposition: "x is outside y" + +--2 Imperatives and infinitives. + + impV2 : V2 -> NP -> Phr ; -- imperative: "solve the equation E" + infV2 : V2 -> NP -> Phr ; -- infinitive: "to solve the equation E" + +--2 Individual-valued function applications + + appN2 : N2 -> NP -> NP ; -- one-place function: "the successor of x" + appN3 : N3 -> NP -> NP -> NP ; -- two-place function: "the distance from x to y" + appColl : N2 -> NP -> NP -> NP ; -- collective function: "the sum of x and y" + +--2 Families of types + +-- These are expressed by relational nouns applied to arguments. + + famN2 : N2 -> NP -> CN ; -- one-place family: "divisor of x" + famN3 : N3 -> NP -> NP -> CN ; -- two-place family: "path from x to y" + famColl : N2 -> NP -> NP -> CN ; -- collective family: "path between x and y" + +--2 Type constructor + +-- This is similar to a family except that the argument is a type. + + typN2 : N2 -> CN -> CN ; -- constructed type: "list of integers" + +} diff --git a/lib/resource-1.0/mathematical/PredicationEng.gf b/lib/resource-1.0/mathematical/PredicationEng.gf new file mode 100644 index 000000000..5a691365e --- /dev/null +++ b/lib/resource-1.0/mathematical/PredicationEng.gf @@ -0,0 +1,3 @@ +concrete PredicationEng of Predication = CatEng ** PredicationI with + (Lang = LangEng) ; + diff --git a/lib/resource-1.0/mathematical/PredicationFin.gf b/lib/resource-1.0/mathematical/PredicationFin.gf new file mode 100644 index 000000000..460439b5f --- /dev/null +++ b/lib/resource-1.0/mathematical/PredicationFin.gf @@ -0,0 +1,3 @@ +concrete PredicationFin of Predication = CatFin ** PredicationI with + (Lang = LangFin) ; + diff --git a/lib/resource-1.0/mathematical/PredicationFre.gf b/lib/resource-1.0/mathematical/PredicationFre.gf new file mode 100644 index 000000000..3c4b9a4d8 --- /dev/null +++ b/lib/resource-1.0/mathematical/PredicationFre.gf @@ -0,0 +1,3 @@ +concrete PredicationFre of Predication = CatFre ** PredicationI with + (Lang = LangFre) ; + diff --git a/lib/resource-1.0/mathematical/PredicationGer.gf b/lib/resource-1.0/mathematical/PredicationGer.gf new file mode 100644 index 000000000..742f2640e --- /dev/null +++ b/lib/resource-1.0/mathematical/PredicationGer.gf @@ -0,0 +1,3 @@ +concrete PredicationGer of Predication = CatGer ** PredicationI with + (Lang = LangGer) ; + diff --git a/lib/resource-1.0/mathematical/PredicationI.gf b/lib/resource-1.0/mathematical/PredicationI.gf new file mode 100644 index 000000000..bbd24be5c --- /dev/null +++ b/lib/resource-1.0/mathematical/PredicationI.gf @@ -0,0 +1,55 @@ +incomplete concrete PredicationI of Predication = Cat ** open ParamX, Lang in { + +flags optimize = all_subs ; + +lin + PosCl cl = UseCl TPres ASimul PPos cl ; + NegCl cl = UseCl TPres ASimul PNeg cl ; + +--2 Predication patterns. + + predV v x = PredVP x (UseV v) ; + predV2 v x y = PredVP x (ComplV2 v y) ; + predV3 v x y z = PredVP x (ComplV3 v y z) ; + predVColl v x y = PredVP (ConjNP and_Conj (BaseNP x y)) (UseV v) ; + predA a x = PredVP x (UseComp (CompAP (PositA a))) ; + predA2 a x y = PredVP x (UseComp (CompAP (ComplA2 a y))) ; + predAComp a x y = PredVP x (UseComp (CompAP (ComparA a y))) ; + predAColl a x y = + PredVP (ConjNP and_Conj (BaseNP x y)) (UseComp (CompAP (PositA a))) ; + predN n x = + PredVP x (UseComp (CompNP (DetCN (DetSg (SgQuant IndefArt) NoOrd) (UseN n)))) ; + predN2 n x y = + PredVP x (UseComp (CompNP (DetCN (DetSg (SgQuant IndefArt) NoOrd) (ComplN2 n y)))) ; + predNColl n x y = PredVP (ConjNP and_Conj (BaseNP x y)) + (UseComp (CompNP (DetCN (DetPl (PlQuant IndefArt) NoNum NoOrd) (UseN n)))) ; + predAdv a x = PredVP x (UseComp (CompAdv a)) ; + predPrep p x y = PredVP x (UseComp (CompAdv (PrepNP p y))) ; + +--2 Imperatives and infinitives. + + impV2 v x = PhrUtt NoPConj (UttImpSg PPos (ImpVP (ComplV2 v x))) NoVoc ; + infV2 v x = PhrUtt NoPConj (UttVP (ComplV2 v x)) NoVoc ; + +--2 Individual-valued function applications + + appN2 n x = DetCN (DetSg (SgQuant DefArt) NoOrd) (ComplN2 n x) ; + appN3 n x y = DetCN (DetSg (SgQuant DefArt) NoOrd) (ComplN2 (ComplN3 n x) y) ; + appColl n x y = + DetCN (DetSg (SgQuant DefArt) NoOrd) (ComplN2 n (ConjNP and_Conj (BaseNP x y))) ; + +--2 Families of types + +-- These are expressed by relational nouns applied to arguments. + + famN2 n x = ComplN2 n x ; + famN3 n x y = ComplN2 (ComplN3 n x) y ; + famColl n x y = ComplN2 n (ConjNP and_Conj (BaseNP x y)) ; + +--2 Type constructor + +-- This is similar to a family except that the argument is a type. + + typN2 f n = ComplN2 f (DetCN (DetPl (PlQuant IndefArt) NoNum NoOrd) n) ; + +} diff --git a/lib/resource-1.0/mathematical/PredicationIta.gf b/lib/resource-1.0/mathematical/PredicationIta.gf new file mode 100644 index 000000000..25ae3ba8d --- /dev/null +++ b/lib/resource-1.0/mathematical/PredicationIta.gf @@ -0,0 +1,3 @@ +concrete PredicationIta of Predication = CatIta ** PredicationI with + (Lang = LangIta) ; + diff --git a/lib/resource-1.0/mathematical/PredicationNor.gf b/lib/resource-1.0/mathematical/PredicationNor.gf new file mode 100644 index 000000000..5af878c97 --- /dev/null +++ b/lib/resource-1.0/mathematical/PredicationNor.gf @@ -0,0 +1,3 @@ +concrete PredicationNor of Predication = CatNor ** PredicationI with + (Lang = LangNor) ; + diff --git a/lib/resource-1.0/mathematical/PredicationSpa.gf b/lib/resource-1.0/mathematical/PredicationSpa.gf new file mode 100644 index 000000000..4d9e0b5f0 --- /dev/null +++ b/lib/resource-1.0/mathematical/PredicationSpa.gf @@ -0,0 +1,3 @@ +concrete PredicationSpa of Predication = CatSpa ** PredicationI with + (Lang = LangSpa) ; + diff --git a/lib/resource-1.0/mathematical/PredicationSwe.gf b/lib/resource-1.0/mathematical/PredicationSwe.gf new file mode 100644 index 000000000..53397b72f --- /dev/null +++ b/lib/resource-1.0/mathematical/PredicationSwe.gf @@ -0,0 +1,3 @@ +concrete PredicationSwe of Predication = CatSwe ** PredicationI with + (Lang = LangSwe) ; + diff --git a/lib/resource-1.0/mathematical/Symbol.gf b/lib/resource-1.0/mathematical/Symbol.gf new file mode 100644 index 000000000..cbc3cd1db --- /dev/null +++ b/lib/resource-1.0/mathematical/Symbol.gf @@ -0,0 +1,31 @@ +--1 Symbolic expressions + +-- *Note*. This module is not automatically included in the main +-- grammar [Lang Lang.html]. + +abstract Symbol = Cat, PredefAbs ** { + +--2 Noun phrases with symbols and numbers + +fun + + SymbPN : Symb -> PN ; -- x + IntPN : Int -> PN ; -- 27 + FloatPN : Float -> PN ; -- 3.14159 + CNIntNP : CN -> Int -> NP ; -- level 53 + CNSymbNP : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y + +--2 Symbol lists + +-- A symbol list has at least two elements. The last two are separated +-- by a conjunction ("and" in English), the others by commas. +-- This produces "x, y and z", in English. + +cat + Symb ; + [Symb]{2} ; + +fun + MkSymb : String -> Symb ; + +} diff --git a/lib/resource-1.0/mathematical/SymbolEng.gf b/lib/resource-1.0/mathematical/SymbolEng.gf new file mode 100644 index 000000000..0b7911fc8 --- /dev/null +++ b/lib/resource-1.0/mathematical/SymbolEng.gf @@ -0,0 +1,27 @@ +concrete SymbolEng of Symbol = CatEng ** open Prelude, ResEng in { + +lin + SymbPN i = {s = \\c => i.s ; a = agrP3 Sg} ; --- c + IntPN i = {s = \\c => i.s ; a = agrP3 Sg} ; --- c + FloatPN i = {s = \\c => i.s ; a = agrP3 Sg} ; --- c + CNIntNP cn i = { + s = \\c => (cn.s ! Sg ! Nom ++ i.s) ; + a = agrP3 Sg + } ; + CNSymbNP det cn xs = { + s = \\c => det.s ++ cn.s ! det.n ! c ++ xs.s ; + a = agrP3 det.n + } ; + +lincat + + Symb, [Symb] = SS ; + +lin + + MkSymb s = s ; + + BaseSymb = infixSS "and" ; + ConsSymb = infixSS "," ; + +} diff --git a/lib/resource-1.0/mathematical/SymbolFin.gf b/lib/resource-1.0/mathematical/SymbolFin.gf new file mode 100644 index 000000000..30324b653 --- /dev/null +++ b/lib/resource-1.0/mathematical/SymbolFin.gf @@ -0,0 +1,31 @@ +concrete SymbolFin of Symbol = CatFin ** open Prelude, NounFin, ResFin in { + +lin + SymbPN i = {s = \\c => i.s} ; --- c + IntPN i = {s = \\c => i.s} ; --- c + FloatPN i = {s = \\c => i.s} ; --- c + + CNIntNP cn i = { + s = \\c => cn.s ! NCase Sg (npform2case c) ++ i.s ; + a = agrP3 Sg ; + isPron = False + } ; + CNSymbNP det cn xs = let detcn = NounFin.DetCN det cn in { + s = \\c => detcn.s ! c ++ xs.s ; + a = detcn.a ; + isPron = False + } ; + +lincat + + Symb, [Symb] = SS ; + +lin + + MkSymb s = s ; + + BaseSymb = infixSS "ja" ; + ConsSymb = infixSS "," ; + +} + diff --git a/lib/resource-1.0/mathematical/SymbolFre.gf b/lib/resource-1.0/mathematical/SymbolFre.gf new file mode 100644 index 000000000..ab972c039 --- /dev/null +++ b/lib/resource-1.0/mathematical/SymbolFre.gf @@ -0,0 +1,2 @@ +concrete SymbolFre of Symbol = CatFre ** SymbolRomance with + (ResRomance = ResFre) ; diff --git a/lib/resource-1.0/mathematical/SymbolGer.gf b/lib/resource-1.0/mathematical/SymbolGer.gf new file mode 100644 index 000000000..e35ed1a4c --- /dev/null +++ b/lib/resource-1.0/mathematical/SymbolGer.gf @@ -0,0 +1,31 @@ +concrete SymbolGer of Symbol = CatGer ** open Prelude, ResGer in { + +lin + SymbPN i = {s = \\c => i.s ; g = Neutr} ; --- c + IntPN i = {s = \\c => i.s ; g = Neutr} ; --- c + FloatPN i = {s = \\c => i.s ; g = Neutr} ; --- c + + CNIntNP cn i = { + s = \\c => cn.s ! Weak ! Sg ! Nom ++ i.s ; + a = agrP3 Sg ; + isPron = False + } ; + CNSymbNP det cn xs = let g = cn.g in { + s = \\c => det.s ! g ! c ++ cn.s ! adjfCase det.a c ! det.n ! c ++ xs.s ; + a = agrP3 det.n ; + isPron = False + } ; + +lincat + + Symb, [Symb] = SS ; + +lin + + MkSymb s = s ; + + BaseSymb = infixSS "und" ; + ConsSymb = infixSS "," ; + +} + diff --git a/lib/resource-1.0/mathematical/SymbolIta.gf b/lib/resource-1.0/mathematical/SymbolIta.gf new file mode 100644 index 000000000..d4e9cbf52 --- /dev/null +++ b/lib/resource-1.0/mathematical/SymbolIta.gf @@ -0,0 +1,2 @@ +concrete SymbolIta of Symbol = CatIta ** SymbolRomance with + (ResRomance = ResIta) ; diff --git a/lib/resource-1.0/mathematical/SymbolNor.gf b/lib/resource-1.0/mathematical/SymbolNor.gf new file mode 100644 index 000000000..2e446b09b --- /dev/null +++ b/lib/resource-1.0/mathematical/SymbolNor.gf @@ -0,0 +1,2 @@ +concrete SymbolNor of Symbol = CatNor ** SymbolScand with + (ResScand = ResNor) ; diff --git a/lib/resource-1.0/mathematical/SymbolRomance.gf b/lib/resource-1.0/mathematical/SymbolRomance.gf new file mode 100644 index 000000000..9b0586c74 --- /dev/null +++ b/lib/resource-1.0/mathematical/SymbolRomance.gf @@ -0,0 +1,31 @@ +incomplete concrete SymbolRomance of Symbol = + CatRomance ** open Prelude, CommonRomance, ResRomance in { + +lin + SymbPN i = {s = i.s ; g = Masc} ; + IntPN i = {s = i.s ; g = Masc} ; + FloatPN i = {s = i.s ; g = Masc} ; + + CNIntNP cn i = { + s = \\c => cn.s ! Sg ++ i.s ; + a = agrP3 cn.g Sg ; + hasClit = False + } ; + CNSymbNP det cn xs = let g = cn.g in { + s = \\c => det.s ! g ! npform2case c ++ cn.s ! det.n ++ xs.s ; + a = agrP3 g det.n ; + hasClit = False + } ; + +lincat + + Symb, [Symb] = SS ; + +lin + + MkSymb s = s ; + + BaseSymb = infixSS "et" ; ---- + ConsSymb = infixSS "," ; + +} diff --git a/lib/resource-1.0/mathematical/SymbolScand.gf b/lib/resource-1.0/mathematical/SymbolScand.gf new file mode 100644 index 000000000..e92aee439 --- /dev/null +++ b/lib/resource-1.0/mathematical/SymbolScand.gf @@ -0,0 +1,28 @@ +incomplete concrete SymbolScand of Symbol = + CatScand ** open Prelude, ResScand, CommonScand in { + +lin + SymbPN i = {s = \\c => i.s ; g = Neutr} ; --- c + IntPN i = {s = \\c => i.s ; g = Neutr} ; --- c + FloatPN i = {s = \\c => i.s ; g = Neutr} ; --- c + CNIntNP cn i = { + s = \\c => (cn.s ! Sg ! DIndef ! Nom ++ i.s) ; + a = agrP3 cn.g Sg + } ; + CNSymbNP det cn xs = let g = cn.g in { + s = \\c => det.s ! cn.isMod ! g ++ cn.s ! det.n ! det.det ! caseNP c ++ xs.s ; + a = agrP3 g det.n + } ; + +lincat + + Symb, [Symb] = SS ; + +lin + + MkSymb s = s ; + + BaseSymb = infixSS conjAnd ; + ConsSymb = infixSS "," ; + +} diff --git a/lib/resource-1.0/mathematical/SymbolSpa.gf b/lib/resource-1.0/mathematical/SymbolSpa.gf new file mode 100644 index 000000000..e56343432 --- /dev/null +++ b/lib/resource-1.0/mathematical/SymbolSpa.gf @@ -0,0 +1,2 @@ +concrete SymbolSpa of Symbol = CatSpa ** SymbolRomance with + (ResRomance = ResSpa) ; diff --git a/lib/resource-1.0/mathematical/SymbolSwe.gf b/lib/resource-1.0/mathematical/SymbolSwe.gf new file mode 100644 index 000000000..b80619c06 --- /dev/null +++ b/lib/resource-1.0/mathematical/SymbolSwe.gf @@ -0,0 +1,2 @@ +concrete SymbolSwe of Symbol = CatSwe ** SymbolScand with + (ResScand = ResSwe) ; diff --git a/lib/resource-1.0/multimodal/DemRes.gf b/lib/resource-1.0/multimodal/DemRes.gf new file mode 100644 index 000000000..fe3fc2c5c --- /dev/null +++ b/lib/resource-1.0/multimodal/DemRes.gf @@ -0,0 +1,31 @@ +resource DemRes = open Prelude in { + + oper + + Point : Type = + {point : Str} ; + + point : Point -> Str = \p -> + p.point ; + + mkPoint : Str -> Point = \s -> + {point = s} ; + + noPoint : Point = + mkPoint [] ; + + concatPoint : (x,y : Point) -> Point = \x,y -> + mkPoint (point x ++ point y) ; + +-- A type is made demonstrative by adding $Point$. + + Dem : Type -> Type = \t -> t ** Point ; + + mkDem : (t : Type) -> t -> Point -> Dem t = \_,x,s -> + x ** s ; + + nonDem : (t : Type) -> t -> Dem t = \t,x -> + mkDem t x noPoint ; + + +} diff --git a/lib/resource-1.0/multimodal/Demonstrative.gf b/lib/resource-1.0/multimodal/Demonstrative.gf new file mode 100644 index 000000000..fffca641d --- /dev/null +++ b/lib/resource-1.0/multimodal/Demonstrative.gf @@ -0,0 +1,88 @@ +abstract Demonstrative = Cat, PredefAbs ** { + +-- Naming convention: $M$ prepended to 'unimodal' names. +-- Exceptions: lexical units, those without unimodal counterparts. + + cat + + MS ; -- multimodal sentence or question + MQS ; -- multimodal wh question + MImp ; -- multimodal imperative + MVP ; -- multimodal verb phrase + MComp ; -- multimodal complement to copula (MAP, MNP, MAdv) + MAP ; -- multimodal adjectival phrase + MNP ; -- multimodal (demonstrative) noun phrase + MAdv ; -- multimodal (demonstrative) adverbial + + Point ; -- pointing gesture + + fun + +-- A pointing gesture is constructed from a string. + + MkPoint : String -> Point ; + +-- Construction of sentences, questions, and imperatives. + + MPredVP : MNP -> MVP -> MS ; -- he flies here + MQPredVP : MNP -> MVP -> MQS ; -- does he fly here + + MQuestVP : IP -> MVP -> MQS ; -- who flies here + + MImpVP : MVP -> MImp ; -- fly here! + +-- Construction of verb phrases from verb + complements. + + MUseV : V -> MVP ; -- flies (here) + MComplV2 : V2 -> MNP -> MVP ; -- takes this (here) + MComplVV : VV -> MVP -> MVP ; -- wants to fly (here) + + MUseComp : MComp -> MVP ; -- is here ; is bigger than this + + MCompAP : MAP -> MComp ; -- bigger than this + MCompNP : MNP -> MComp ; -- the price of this + MCompAdv : MAdv -> MComp ; -- here + + MPositA : A -> MAP ; -- big + MComparA : A -> MNP -> MAP ; -- bigger than this + +-- Adverbial modification of a verb phrase. + + MAdvVP : MVP -> MAdv -> MVP ; -- fly here + +-- Demonstrative pronouns as NPs and determiners. + + this_MNP : Point -> MNP ; -- this + that_MNP : Point -> MNP ; -- that + thisDet_MNP : CN -> Point -> MNP ; -- this car + thatDet_MNP : CN -> Point -> MNP ; -- that car + +-- Demonstrative adverbs. + + here_MAdv : Point -> MAdv ; -- here + here7from_MAdv : Point -> MAdv ; -- from here + here7to_MAdv : Point -> MAdv ; -- to here + +-- Building an adverb as prepositional phrase. + + MPrepNP : Prep -> MNP -> MAdv ; -- in this car + +-- Using ordinary categories. + +-- Mounting nondemonstrative expressions. + + DemNP : NP -> MNP ; + DemAdv : Adv -> MAdv ; + +-- Top-level phrases. + + PhrMS : Pol -> MS -> Phr ; + PhrMS : Pol -> MS -> Phr ; + PhrMQS : Pol -> MQS -> Phr ; + PhrMImp : Pol -> MImp -> Phr ; + +-- For testing and example-based grammar writing. + + point1, point2 : Point ; + +} diff --git a/lib/resource-1.0/multimodal/DemonstrativeEng.gf b/lib/resource-1.0/multimodal/DemonstrativeEng.gf new file mode 100644 index 000000000..82e323903 --- /dev/null +++ b/lib/resource-1.0/multimodal/DemonstrativeEng.gf @@ -0,0 +1,4 @@ +--# -path=.:../english/:../abstract:../common:prelude + +concrete DemonstrativeEng of Demonstrative = CatEng ** DemonstrativeI with + (Lang = LangEng) ; diff --git a/lib/resource-1.0/multimodal/DemonstrativeFin.gf b/lib/resource-1.0/multimodal/DemonstrativeFin.gf new file mode 100644 index 000000000..2e99961cb --- /dev/null +++ b/lib/resource-1.0/multimodal/DemonstrativeFin.gf @@ -0,0 +1,4 @@ +--# -path=.:../finnish/:../abstract:../common:prelude + +concrete DemonstrativeFin of Demonstrative = CatFin ** DemonstrativeI with + (Lang = LangFin) ; diff --git a/lib/resource-1.0/multimodal/DemonstrativeFre.gf b/lib/resource-1.0/multimodal/DemonstrativeFre.gf new file mode 100644 index 000000000..19b4497c6 --- /dev/null +++ b/lib/resource-1.0/multimodal/DemonstrativeFre.gf @@ -0,0 +1,2 @@ +concrete DemonstrativeFre of Demonstrative = CatFre ** DemonstrativeI with + (Lang = LangFre) ; diff --git a/lib/resource-1.0/multimodal/DemonstrativeGer.gf b/lib/resource-1.0/multimodal/DemonstrativeGer.gf new file mode 100644 index 000000000..32cb8c8fe --- /dev/null +++ b/lib/resource-1.0/multimodal/DemonstrativeGer.gf @@ -0,0 +1,4 @@ +--# -path=.:../german/:../abstract:../common:prelude + +concrete DemonstrativeGer of Demonstrative = CatGer ** DemonstrativeI with + (Lang = LangGer) ; diff --git a/lib/resource-1.0/multimodal/DemonstrativeI.gf b/lib/resource-1.0/multimodal/DemonstrativeI.gf new file mode 100644 index 000000000..3032eaf46 --- /dev/null +++ b/lib/resource-1.0/multimodal/DemonstrativeI.gf @@ -0,0 +1,106 @@ +incomplete concrete DemonstrativeI of Demonstrative = Cat ** + open Prelude, Lang, ParamX, DemRes in { + + flags optimize = all_subs ; + + lincat + + MS = Dem {s : Polarity => Str} ; + MQS = Dem {s : Polarity => Str} ; + MImp = Dem {s : Polarity => Str} ; + MVP = Dem VP ; + MComp = Dem Comp ; + MAP = Dem AP ; + MNP = Dem NP ; + MAdv = Dem Adv ; + + Point = DemRes.Point ; + + lin + + MkPoint s = mkPoint s.s ; + + MPredVP np vp = + let cl = PredVP np vp + in + mkDem + {s : Polarity => Str} + (polCases + (UttS (UseCl TPres ASimul PPos cl)) + (UttS (UseCl TPres ASimul PNeg cl))) + (concatPoint np vp) ; + + MQPredVP np vp = + let cl = QuestCl (PredVP np vp) + in + mkDem + {s : Polarity => Str} + (polCases + (UttQS (UseQCl TPres ASimul PPos cl)) + (UttQS (UseQCl TPres ASimul PNeg cl))) + (concatPoint np vp) ; + + MQuestVP np vp = + let cl = QuestVP np vp + in + mkDem + {s : Polarity => Str} + (polCases + (UttQS (UseQCl TPres ASimul PPos cl)) + (UttQS (UseQCl TPres ASimul PNeg cl))) + vp ; + + MImpVP vp = + let imp = ImpVP vp + in + mkDem + {s : Polarity => Str} + (polCases + ((UttImpSg PPos imp)) + ((UttImpSg PNeg imp))) + vp ; + + + MUseV verb = mkDem VP (UseV verb) noPoint ; + MComplV2 verb obj = mkDem VP (ComplV2 verb obj) obj ; + MComplVV vv vp = mkDem VP (ComplVV vv vp) vp ; + + MUseComp comp = mkDem VP (UseComp comp) comp ; + + MCompAP ap = mkDem Comp (CompAP ap) ap ; + MCompAdv adv = mkDem Comp (CompAdv adv) adv ; + MCompNP np = mkDem Comp (CompNP np) np ; + + MPositA a = mkDem AP (PositA a) noPoint ; + MComparA a np = mkDem AP (ComparA a np) np ; + + + MAdvVP vp adv = + mkDem VP (AdvVP vp adv) (concatPoint vp adv) ; + + this_MNP = mkDem NP this_NP ; + that_MNP = mkDem NP that_NP ; + + thisDet_MNP cn = + mkDem NP (DetCN (DetSg (SgQuant this_Quant) NoOrd) cn) ; + thatDet_MNP cn = + mkDem NP (DetCN (DetSg (SgQuant that_Quant) NoOrd) cn) ; + + here_MAdv = mkDem Adv here_Adv ; + here7from_MAdv = mkDem Adv here7from_Adv ; + here7to_MAdv = mkDem Adv here7to_Adv ; + + MPrepNP p np = mkDem Adv (PrepNP p np) np ; + + DemNP np = nonDem NP (np ** {lock_NP = <>}) ; + DemAdv adv = nonDem Adv (adv ** {lock_Adv = <>}) ; + + PhrMS pol ms = {s = pol.s ++ ms.s ! pol.p ++ ";" ++ ms.point} ; + PhrMQS pol ms = {s = pol.s ++ ms.s ! pol.p ++ ";" ++ ms.point} ; + PhrMImp pol ms = {s = pol.s ++ ms.s ! pol.p ++ ";" ++ ms.point} ; + + point1 = mkPoint "p1" ; + point2 = mkPoint "p2" ; + +} + diff --git a/lib/resource-1.0/multimodal/DemonstrativeIta.gf b/lib/resource-1.0/multimodal/DemonstrativeIta.gf new file mode 100644 index 000000000..ef57a5f57 --- /dev/null +++ b/lib/resource-1.0/multimodal/DemonstrativeIta.gf @@ -0,0 +1,2 @@ +concrete DemonstrativeIta of Demonstrative = CatIta ** DemonstrativeI with + (Lang = LangIta) ; diff --git a/lib/resource-1.0/multimodal/DemonstrativeNor.gf b/lib/resource-1.0/multimodal/DemonstrativeNor.gf new file mode 100644 index 000000000..ca5b28158 --- /dev/null +++ b/lib/resource-1.0/multimodal/DemonstrativeNor.gf @@ -0,0 +1,2 @@ +concrete DemonstrativeNor of Demonstrative = CatNor ** DemonstrativeI with + (Lang = LangNor) ; diff --git a/lib/resource-1.0/multimodal/DemonstrativeSpa.gf b/lib/resource-1.0/multimodal/DemonstrativeSpa.gf new file mode 100644 index 000000000..9dd98f234 --- /dev/null +++ b/lib/resource-1.0/multimodal/DemonstrativeSpa.gf @@ -0,0 +1,2 @@ +concrete DemonstrativeSpa of Demonstrative = CatSpa ** DemonstrativeI with + (Lang = LangSpa) ; diff --git a/lib/resource-1.0/multimodal/DemonstrativeSwe.gf b/lib/resource-1.0/multimodal/DemonstrativeSwe.gf new file mode 100644 index 000000000..a34ae1f2a --- /dev/null +++ b/lib/resource-1.0/multimodal/DemonstrativeSwe.gf @@ -0,0 +1,4 @@ +concrete DemonstrativeSwe of Demonstrative = CatSwe ** DemonstrativeI with + (Lang = LangSwe) ; + + diff --git a/lib/resource-1.0/multimodal/Multimodal.gf b/lib/resource-1.0/multimodal/Multimodal.gf new file mode 100644 index 000000000..028d27eab --- /dev/null +++ b/lib/resource-1.0/multimodal/Multimodal.gf @@ -0,0 +1,16 @@ +abstract Multimodal = + Noun, +-- Verb, + Adjective, + Adverb, + Numeral, +-- Sentence, +-- Question, +-- Relative, +-- Conjunction, +-- Phrase, +-- Tensed, + Structural, + Demonstrative, + Lexicon + ** {} ; diff --git a/lib/resource-1.0/multimodal/MultimodalEng.gf b/lib/resource-1.0/multimodal/MultimodalEng.gf new file mode 100644 index 000000000..2b1b63672 --- /dev/null +++ b/lib/resource-1.0/multimodal/MultimodalEng.gf @@ -0,0 +1,19 @@ +--# -path=.:present:prelude + +concrete MultimodalEng of Multimodal = + NounEng, +-- Verb, + AdjectiveEng, + AdverbEng, + NumeralEng, +-- Sentence, +-- Question, +-- Relative, +-- Conjunction, +-- Phrase, +-- Tensed, + StructuralEng, + DemonstrativeEng, + LexiconEng + ** {} ; + diff --git a/lib/resource-1.0/multimodal/MultimodalFin.gf b/lib/resource-1.0/multimodal/MultimodalFin.gf new file mode 100644 index 000000000..71cadb4cf --- /dev/null +++ b/lib/resource-1.0/multimodal/MultimodalFin.gf @@ -0,0 +1,18 @@ +--# -path=.:present:prelude + +concrete MultimodalFin of Multimodal = + NounFin, +-- Verb, + AdjectiveFin, + AdverbFin, + NumeralFin, +-- Sentence, +-- Question, +-- Relative, +-- Conjunction, +-- Phrase, +-- Tensed, + StructuralFin, + DemonstrativeFin, + LexiconFin + ** {} ; diff --git a/lib/resource-1.0/multimodal/MultimodalFre.gf b/lib/resource-1.0/multimodal/MultimodalFre.gf new file mode 100644 index 000000000..4c845bc29 --- /dev/null +++ b/lib/resource-1.0/multimodal/MultimodalFre.gf @@ -0,0 +1,19 @@ +--# -path=.:present:prelude + +concrete MultimodalFre of Multimodal = + NounFre, +-- Verb, + AdjectiveFre, + AdverbFre, +-- NumeralFre, +-- Sentence, +-- Question, +-- Relative, +-- Conjunction, +-- Phrase, +-- Tensed, + StructuralFre, + DemonstrativeFre, + LexiconFre + ** {} ; + diff --git a/lib/resource-1.0/multimodal/MultimodalGer.gf b/lib/resource-1.0/multimodal/MultimodalGer.gf new file mode 100644 index 000000000..7514fd406 --- /dev/null +++ b/lib/resource-1.0/multimodal/MultimodalGer.gf @@ -0,0 +1,18 @@ +--# -path=.:present:prelude + +concrete MultimodalGer of Multimodal = + NounGer, +-- Verb, + AdjectiveGer, + AdverbGer, + NumeralGer, +-- Sentence, +-- Question, +-- Relative, +-- Conjunction, +-- Phrase, +-- Tensed, + StructuralGer, + DemonstrativeGer, + LexiconGer + ** {} ; diff --git a/lib/resource-1.0/multimodal/MultimodalIta.gf b/lib/resource-1.0/multimodal/MultimodalIta.gf new file mode 100644 index 000000000..060d9c7b8 --- /dev/null +++ b/lib/resource-1.0/multimodal/MultimodalIta.gf @@ -0,0 +1,19 @@ +--# -path=.:present:prelude + +concrete MultimodalIta of Multimodal = + NounIta, +-- Verb, + AdjectiveIta, + AdverbIta, +-- NumeralIta, +-- Sentence, +-- Question, +-- Relative, +-- Conjunction, +-- Phrase, +-- Tensed, + StructuralIta, + DemonstrativeIta, + LexiconIta + ** {} ; + diff --git a/lib/resource-1.0/multimodal/MultimodalNor.gf b/lib/resource-1.0/multimodal/MultimodalNor.gf new file mode 100644 index 000000000..54ca6a64f --- /dev/null +++ b/lib/resource-1.0/multimodal/MultimodalNor.gf @@ -0,0 +1,19 @@ +--# -path=.:present:prelude + +concrete MultimodalNor of Multimodal = + NounNor, +-- Verb, + AdjectiveNor, + AdverbNor, + NumeralNor, +-- Sentence, +-- Question, +-- Relative, +-- Conjunction, +-- Phrase, +-- Tensed, + StructuralNor, + DemonstrativeNor, + LexiconNor + ** {} ; + diff --git a/lib/resource-1.0/multimodal/MultimodalSpa.gf b/lib/resource-1.0/multimodal/MultimodalSpa.gf new file mode 100644 index 000000000..b311d4ec3 --- /dev/null +++ b/lib/resource-1.0/multimodal/MultimodalSpa.gf @@ -0,0 +1,19 @@ +--# -path=.:present:prelude + +concrete MultimodalSpa of Multimodal = + NounSpa, +-- Verb, + AdjectiveSpa, + AdverbSpa, +-- NumeralSpa, +-- Sentence, +-- Question, +-- Relative, +-- Conjunction, +-- Phrase, +-- Tensed, + StructuralSpa, + DemonstrativeSpa, + LexiconSpa + ** {} ; + diff --git a/lib/resource-1.0/multimodal/MultimodalSwe.gf b/lib/resource-1.0/multimodal/MultimodalSwe.gf new file mode 100644 index 000000000..0d55a7d92 --- /dev/null +++ b/lib/resource-1.0/multimodal/MultimodalSwe.gf @@ -0,0 +1,19 @@ +--# -path=.:present:prelude + +concrete MultimodalSwe of Multimodal = + NounSwe, +-- Verb, + AdjectiveSwe, + AdverbSwe, + NumeralSwe, +-- Sentence, +-- Question, +-- Relative, +-- Conjunction, +-- Phrase, +-- Tensed, + StructuralSwe, + DemonstrativeSwe, + LexiconSwe + ** {} ; +