forked from GitHub/gf-rgl
MAth
This commit is contained in:
@@ -6,7 +6,8 @@ abstract Lang =
|
|||||||
Structural,
|
Structural,
|
||||||
Basic,
|
Basic,
|
||||||
Time,
|
Time,
|
||||||
Country
|
Country,
|
||||||
|
Math
|
||||||
|
|
||||||
** {
|
** {
|
||||||
fun
|
fun
|
||||||
|
|||||||
52
resource/abstract/Math.gf
Normal file
52
resource/abstract/Math.gf
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
|
||||||
|
|
||||||
|
abstract Math = Categories ** {
|
||||||
|
|
||||||
|
--3 Noun phrases with symbols
|
||||||
|
|
||||||
|
fun
|
||||||
|
SymbPN : String -> PN ; -- "x"
|
||||||
|
IntPN : Int -> PN ; -- "27"
|
||||||
|
IntNP : CN -> Int -> NP ; -- "level 53"
|
||||||
|
|
||||||
|
IndefSymbNumNP : Num -> CN -> SymbList -> NP ; -- "(2) numbers x and y"
|
||||||
|
DefSymbNumNP : Num -> CN -> SymbList -> NP ; -- "the (2) numbers x and y"
|
||||||
|
NDetSymbNP : NDet -> Num -> CN -> SymbList -> NP ; -- "some (3) points x, y and z"
|
||||||
|
|
||||||
|
--3 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
|
||||||
|
SymbList ;
|
||||||
|
|
||||||
|
fun
|
||||||
|
SymbTwo : String -> String -> SymbList ;
|
||||||
|
SymbMore : String -> SymbList -> SymbList ;
|
||||||
|
|
||||||
|
--3 Special forms of expression
|
||||||
|
|
||||||
|
-- These expression forms are typical of mathematical texts.
|
||||||
|
|
||||||
|
LetCN : String -> CN -> Imp ; -- Let x be a number.
|
||||||
|
LetNumCN : SymbList -> Num -> CN -> Imp ; -- Let x and y be (2) numbers.
|
||||||
|
|
||||||
|
-- This rule is slightly overgenerating: "there exists every number x".
|
||||||
|
-- The problem seems to be of semantic nature. By this we avoid having many rules.
|
||||||
|
|
||||||
|
ExistNP : NP -> Cl ; -- there exist (2) number(s) x and y
|
||||||
|
|
||||||
|
--3 Rules moved from $Rules$.
|
||||||
|
|
||||||
|
-- This rule is powerful but overgenerating.
|
||||||
|
|
||||||
|
SymbCN : CN -> String -> CN ; -- "number x"
|
||||||
|
|
||||||
|
-- This rule is simply wrong, and will be deprecated: the correct
|
||||||
|
-- value type is $NP$.
|
||||||
|
|
||||||
|
IntCN : CN -> Int -> CN ; -- "level 53"
|
||||||
|
|
||||||
|
}
|
||||||
@@ -17,9 +17,12 @@ fun
|
|||||||
UseN : N -> CN ; -- "car"
|
UseN : N -> CN ; -- "car"
|
||||||
UsePN : PN -> NP ; -- "John"
|
UsePN : PN -> NP ; -- "John"
|
||||||
|
|
||||||
|
-- These three rules have been moved to the module $Math$.
|
||||||
|
{-
|
||||||
SymbPN : String -> PN ; -- "x"
|
SymbPN : String -> PN ; -- "x"
|
||||||
SymbCN : CN -> String -> CN ; -- "number x"
|
SymbCN : CN -> String -> CN ; -- "number x"
|
||||||
IntCN : CN -> Int -> CN ; -- "number 53"
|
IntCN : CN -> Int -> CN ; -- "number 53"
|
||||||
|
-}
|
||||||
|
|
||||||
IndefOneNP : CN -> NP ; -- "a car", "cars"
|
IndefOneNP : CN -> NP ; -- "a car", "cars"
|
||||||
IndefNumNP : Num -> CN -> NP ; -- "houses", "86 houses"
|
IndefNumNP : Num -> CN -> NP ; -- "houses", "86 houses"
|
||||||
|
|||||||
4
resource/danish/MathDan.gf
Normal file
4
resource/danish/MathDan.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete MathDan of Math = CategoriesDan **
|
||||||
|
MathScand with (SyntaxScand=SyntaxDan) ;
|
||||||
@@ -116,4 +116,5 @@ instance SyntaxDan of SyntaxScand = TypesDan **
|
|||||||
{s = verbVara.s ; s1 = "ved" ; isAux = False}
|
{s = verbVara.s ; s1 = "ved" ; isAux = False}
|
||||||
vp) ;
|
vp) ;
|
||||||
|
|
||||||
|
conjEt = "og" ;
|
||||||
}
|
}
|
||||||
@@ -6,7 +6,8 @@ concrete LangEng of Lang =
|
|||||||
StructuralEng,
|
StructuralEng,
|
||||||
BasicEng,
|
BasicEng,
|
||||||
TimeEng,
|
TimeEng,
|
||||||
CountryEng
|
CountryEng,
|
||||||
|
MathEng
|
||||||
|
|
||||||
** open Prelude, ParadigmsEng in {
|
** open Prelude, ParadigmsEng in {
|
||||||
|
|
||||||
|
|||||||
49
resource/english/MathEng.gf
Normal file
49
resource/english/MathEng.gf
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
--# -path=.:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete MathEng of Math = CategoriesEng ** open Prelude, SyntaxEng, ParadigmsEng in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
SymbPN i = {s = \\c => caseSymb c i.s ; g = Neutr} ;
|
||||||
|
IntPN i = {s = \\c => caseSymb c i.s ; g = Neutr} ;
|
||||||
|
IntNP cn i = nameNounPhrase {
|
||||||
|
s = \\c => (cn.s ! Sg ! Nom ++ caseSymb c i.s) ;
|
||||||
|
g = Neutr
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IndefSymbNumNP nu cn xs =
|
||||||
|
addSymbNounPhrase (indefNounPhraseNum plural nu cn) xs.s ;
|
||||||
|
DefSymbNumNP nu cn xs =
|
||||||
|
addSymbNounPhrase (defNounPhraseNum plural nu cn) xs.s ;
|
||||||
|
NDetSymbNP det nu cn xs =
|
||||||
|
addSymbNounPhrase (numDetNounPhrase det nu cn) xs.s ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
SymbList = SS ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
SymbTwo = infixSS "and" ;
|
||||||
|
SymbMore = infixSS "," ;
|
||||||
|
|
||||||
|
|
||||||
|
LetCN x cn = {
|
||||||
|
s = \\_ => "let" ++ x.s ++ "be" ++ (indefNounPhrase singular cn).s ! NomP
|
||||||
|
} ;
|
||||||
|
LetNumCN x nu cn = {
|
||||||
|
s = \\_ => "let" ++ x.s ++ "be" ++ (indefNounPhraseNum plural nu cn).s ! NomP
|
||||||
|
} ;
|
||||||
|
ExistNP np = predVerbClause
|
||||||
|
(nameNounPhraseN (fromAgr np.a).n (nameReg "there" Neutr))
|
||||||
|
(regV "exist")
|
||||||
|
(complNounPhrase np) ;
|
||||||
|
|
||||||
|
-- Moved from $RulesEng$.
|
||||||
|
|
||||||
|
SymbCN cn s =
|
||||||
|
{s = \\n,c => cn.s ! n ! Nom ++ caseSymb c s.s ;
|
||||||
|
g = cn.g} ;
|
||||||
|
IntCN cn s =
|
||||||
|
{s = \\n,c => cn.s ! n ! Nom ++ caseSymb c s.s ;
|
||||||
|
g = cn.g} ;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -28,14 +28,6 @@ lin
|
|||||||
UseN = noun2CommNounPhrase ;
|
UseN = noun2CommNounPhrase ;
|
||||||
UsePN = nameNounPhrase ;
|
UsePN = nameNounPhrase ;
|
||||||
|
|
||||||
SymbPN i = {s = table {Nom => i.s ; Gen => i.s ++ "'s"} ; g = Neutr} ; ---
|
|
||||||
SymbCN cn s =
|
|
||||||
{s = \\n,c => cn.s ! n ! c ++ s.s ;
|
|
||||||
g = cn.g} ;
|
|
||||||
IntCN cn s =
|
|
||||||
{s = \\n,c => cn.s ! n ! c ++ s.s ;
|
|
||||||
g = cn.g} ;
|
|
||||||
|
|
||||||
IndefOneNP = indefNounPhrase singular ;
|
IndefOneNP = indefNounPhrase singular ;
|
||||||
IndefNumNP = indefNounPhraseNum plural ;
|
IndefNumNP = indefNounPhraseNum plural ;
|
||||||
DefOneNP = defNounPhrase singular ;
|
DefOneNP = defNounPhrase singular ;
|
||||||
|
|||||||
@@ -66,11 +66,17 @@ oper
|
|||||||
APl p => {n = Pl ; p = p ; g = human}
|
APl p => {n = Pl ; p = p ; g = human}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
nameNounPhrase : ProperName -> NounPhrase = \john ->
|
caseSymb : Case -> Str -> Str = \c,i -> case c of {
|
||||||
{s = \\c => john.s ! toCase c ; a = toAgr Sg P3 john.g} ;
|
Nom => i ;
|
||||||
|
Gen => glue i "'s"
|
||||||
|
} ;
|
||||||
|
|
||||||
nameNounPhrasePl : ProperName -> NounPhrase = \john ->
|
nameNounPhrase : ProperName -> NounPhrase =
|
||||||
{s = \\c => john.s ! toCase c ; a = toAgr Pl P3 john.g} ;
|
nameNounPhraseN Sg ;
|
||||||
|
nameNounPhrasePl : ProperName -> NounPhrase =
|
||||||
|
nameNounPhraseN Pl ;
|
||||||
|
nameNounPhraseN : Number -> ProperName -> NounPhrase = \n,john ->
|
||||||
|
{s = \\c => john.s ! toCase c ; a = toAgr n P3 john.g} ;
|
||||||
|
|
||||||
-- The following construction has to be refined for genitive forms:
|
-- The following construction has to be refined for genitive forms:
|
||||||
-- "we two", "us two" are OK, but "our two" is not.
|
-- "we two", "us two" are OK, but "our two" is not.
|
||||||
@@ -86,6 +92,14 @@ oper
|
|||||||
pronNounPhrase : Pronoun -> NounPhrase = \pro ->
|
pronNounPhrase : Pronoun -> NounPhrase = \pro ->
|
||||||
{s = pro.s ; a = toAgr pro.n pro.p pro.g} ;
|
{s = pro.s ; a = toAgr pro.n pro.p pro.g} ;
|
||||||
|
|
||||||
|
-- To add a symbol, such as a variable or variable list, to the end of
|
||||||
|
-- an NP.
|
||||||
|
|
||||||
|
addSymbNounPhrase : NounPhrase -> Str -> NounPhrase = \np,x ->
|
||||||
|
{s = \\c => np.s ! c ++ x ;
|
||||||
|
a = np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
--2 Determiners
|
--2 Determiners
|
||||||
--
|
--
|
||||||
-- Determiners are inflected according to the nouns they determine.
|
-- Determiners are inflected according to the nouns they determine.
|
||||||
|
|||||||
@@ -4,9 +4,10 @@ concrete LangFin of Lang =
|
|||||||
RulesFin,
|
RulesFin,
|
||||||
ClauseFin,
|
ClauseFin,
|
||||||
StructuralFin,
|
StructuralFin,
|
||||||
BasicFin
|
BasicFin,
|
||||||
---- TimeEng,
|
---- TimeEng,
|
||||||
---- CountryEng
|
---- CountryEng
|
||||||
|
MathFin
|
||||||
|
|
||||||
** open Prelude, ParadigmsFin in {
|
** open Prelude, ParadigmsFin in {
|
||||||
|
|
||||||
|
|||||||
50
resource/finnish/MathFin.gf
Normal file
50
resource/finnish/MathFin.gf
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
--# -path=.:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete MathFin of Math = CategoriesFin ** open Prelude, SyntaxFin, ParadigmsFin in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
SymbPN i = {s = \\c => i.s} ; --- case endings often needed
|
||||||
|
IntPN i = {s = \\c => i.s} ;
|
||||||
|
IntNP cn i = nameNounPhrase {
|
||||||
|
s = \\c => cn.s ! False ! Sg ! c ++ i.s
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IndefSymbNumNP nu cn xs =
|
||||||
|
addSymbNounPhrase (nounPhraseNum False nu cn) xs.s ;
|
||||||
|
DefSymbNumNP nu cn xs =
|
||||||
|
addSymbNounPhrase (nounPhraseNum True nu cn) xs.s ;
|
||||||
|
NDetSymbNP det nu cn xs =
|
||||||
|
addSymbNounPhrase (numDetNounPhrase det nu cn) xs.s ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
SymbList = SS ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
SymbTwo = infixSS "ja" ;
|
||||||
|
SymbMore = infixSS "," ;
|
||||||
|
|
||||||
|
|
||||||
|
LetCN x cn = {
|
||||||
|
s = \\_ => "olkoon" ++ x.s ++ (indefNounPhrase singular cn).s !
|
||||||
|
NPCase Nom
|
||||||
|
} ;
|
||||||
|
LetNumCN x nu cn = {
|
||||||
|
s = \\_ => "olkoot" ++ x.s ++ (nounPhraseNum False nu cn).s
|
||||||
|
! NPCase Part
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ExistNP np =
|
||||||
|
sats2clause (
|
||||||
|
mkSatsCopula impersNounPhrase ("olemassa" ++ np.s ! NPCase Nom)
|
||||||
|
) ;
|
||||||
|
|
||||||
|
-- Moved from $RulesFin$.
|
||||||
|
|
||||||
|
SymbCN cn s =
|
||||||
|
{s = \\f,n,c => cn.s ! f ! n ! c ++ s.s ;
|
||||||
|
g = cn.g} ;
|
||||||
|
IntCN cn s =
|
||||||
|
{s = \\f,n,c => cn.s ! f ! n ! c ++ s.s ;
|
||||||
|
g = cn.g} ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -24,14 +24,6 @@ lin
|
|||||||
UseN = noun2CommNounPhrase ;
|
UseN = noun2CommNounPhrase ;
|
||||||
UsePN = nameNounPhrase ;
|
UsePN = nameNounPhrase ;
|
||||||
|
|
||||||
SymbPN i = {s = \\_ => i.s} ; --- case endings often needed
|
|
||||||
SymbCN cn s =
|
|
||||||
{s = \\f,n,c => cn.s ! f ! n ! c ++ s.s ;
|
|
||||||
g = cn.g} ;
|
|
||||||
IntCN cn s =
|
|
||||||
{s = \\f,n,c => cn.s ! f ! n ! c ++ s.s ;
|
|
||||||
g = cn.g} ;
|
|
||||||
|
|
||||||
IndefOneNP = indefNounPhrase singular ;
|
IndefOneNP = indefNounPhrase singular ;
|
||||||
IndefNumNP = nounPhraseNum False ;
|
IndefNumNP = nounPhraseNum False ;
|
||||||
DefOneNP = defNounPhrase singular ;
|
DefOneNP = defNounPhrase singular ;
|
||||||
@@ -206,6 +198,8 @@ lin
|
|||||||
|
|
||||||
---- OneNP = nameNounPhrase (nameReg "one" human) ;
|
---- OneNP = nameNounPhrase (nameReg "one" human) ;
|
||||||
|
|
||||||
|
--- should be partitive in negative forms: "ei ole olemassa puista autoa"
|
||||||
|
|
||||||
ExistCN cn =
|
ExistCN cn =
|
||||||
sats2clause (
|
sats2clause (
|
||||||
mkSatsCopula impersNounPhrase ("olemassa" ++ (singularNounPhrase cn).s ! NPCase Nom)
|
mkSatsCopula impersNounPhrase ("olemassa" ++ (singularNounPhrase cn).s ! NPCase Nom)
|
||||||
|
|||||||
@@ -157,6 +157,14 @@ oper
|
|||||||
|
|
||||||
noNum : Numeral = {s = \\_ => [] ; isNum = False ; n = Pl} ;
|
noNum : Numeral = {s = \\_ => [] ; isNum = False ; n = Pl} ;
|
||||||
|
|
||||||
|
-- To add a symbol, such as a variable or variable list, to the end of
|
||||||
|
-- an NP.
|
||||||
|
|
||||||
|
addSymbNounPhrase : NounPhrase -> Str -> NounPhrase = \np,x ->
|
||||||
|
{s = \\c => np.s ! c ++ x ;
|
||||||
|
n = np.n ;
|
||||||
|
p = np.p
|
||||||
|
} ;
|
||||||
|
|
||||||
--2 Determiners
|
--2 Determiners
|
||||||
--
|
--
|
||||||
|
|||||||
4
resource/french/MathFre.gf
Normal file
4
resource/french/MathFre.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
--# -path=.:../romance:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete MathFre of Math = CategoriesFre **
|
||||||
|
MathRomance with (SyntaxRomance=SyntaxFre) ;
|
||||||
4
resource/italian/MathIta.gf
Normal file
4
resource/italian/MathIta.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
--# -path=.:../romance:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete MathIta of Math = CategoriesIta **
|
||||||
|
MathRomance with (SyntaxRomance=SyntaxIta) ;
|
||||||
4
resource/norwegian/MathNor.gf
Normal file
4
resource/norwegian/MathNor.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete MathNor of Math = CategoriesNor **
|
||||||
|
MathScand with (SyntaxScand=SyntaxNor) ;
|
||||||
@@ -117,4 +117,7 @@ instance SyntaxNor of SyntaxScand = TypesNor **
|
|||||||
(complVerbVerb
|
(complVerbVerb
|
||||||
({s = verbVara.s ; s1 = "ved" ; isAux = False})
|
({s = verbVara.s ; s1 = "ved" ; isAux = False})
|
||||||
vp) ;
|
vp) ;
|
||||||
|
|
||||||
|
conjEt = "og" ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
51
resource/romance/MathRomance.gf
Normal file
51
resource/romance/MathRomance.gf
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
--# -path=.:../romance:../abstract:../../prelude
|
||||||
|
|
||||||
|
incomplete concrete MathRomance of Math = CategoriesRomance **
|
||||||
|
open Prelude, SyntaxRomance in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
SymbPN i = {s = i.s ; g = Masc} ; --- cannot know gender
|
||||||
|
IntPN i = {s = i.s ; g = Masc} ;
|
||||||
|
IntNP cn i = nameNounPhrase {
|
||||||
|
s = cn.s ! Sg ++ i.s ;
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IndefSymbNumNP nu cn xs =
|
||||||
|
addSymbNounPhrase (indefNounPhraseNum nu cn) xs.s ;
|
||||||
|
DefSymbNumNP nu cn xs =
|
||||||
|
addSymbNounPhrase (defNounPhraseNum nu cn) xs.s ;
|
||||||
|
NDetSymbNP det nu cn xs =
|
||||||
|
addSymbNounPhrase (numDetNounPhrase det nu cn) xs.s ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
SymbList = SS ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
SymbTwo = infixSS etConj.s ;
|
||||||
|
SymbMore = infixSS "," ;
|
||||||
|
|
||||||
|
|
||||||
|
LetCN x cn = {
|
||||||
|
s = \\_,_ => copula.s ! VFin (VPres Con) Sg P3 ++ x.s ++ (indefNounPhrase singular cn).s !
|
||||||
|
unstressed nominative
|
||||||
|
} ;
|
||||||
|
LetNumCN x nu cn = {
|
||||||
|
s = \\_,_ => copula.s ! VFin (VPres Con) Pl P3 ++ x.s ++ (indefNounPhraseNum nu cn).s
|
||||||
|
! unstressed nominative
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--- to be replaced by "il existe", "esiste", etc.
|
||||||
|
|
||||||
|
ExistNP np = existNounPhrase np ;
|
||||||
|
|
||||||
|
-- Moved from $RulesRomance$.
|
||||||
|
|
||||||
|
SymbCN cn s =
|
||||||
|
{s = \\n => cn.s ! n ++ s.s ;
|
||||||
|
g = cn.g} ;
|
||||||
|
IntCN cn i =
|
||||||
|
{s = \\n => cn.s ! n ++ i.s ;
|
||||||
|
g = cn.g} ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -7,14 +7,6 @@ lin
|
|||||||
UseN = noun2CommNounPhrase ;
|
UseN = noun2CommNounPhrase ;
|
||||||
UsePN = nameNounPhrase ;
|
UsePN = nameNounPhrase ;
|
||||||
|
|
||||||
SymbPN i = {s = i.s ; g = Masc} ; --- cannot know gender
|
|
||||||
SymbCN cn s =
|
|
||||||
{s = \\n => cn.s ! n ++ s.s ;
|
|
||||||
g = cn.g} ;
|
|
||||||
IntCN cn i =
|
|
||||||
{s = \\n => cn.s ! n ++ i.s ;
|
|
||||||
g = cn.g} ;
|
|
||||||
|
|
||||||
IndefOneNP = indefNounPhrase singular ;
|
IndefOneNP = indefNounPhrase singular ;
|
||||||
IndefNumNP = indefNounPhraseNum ;
|
IndefNumNP = indefNounPhraseNum ;
|
||||||
DefOneNP = defNounPhrase singular ;
|
DefOneNP = defNounPhrase singular ;
|
||||||
|
|||||||
@@ -80,6 +80,17 @@ oper
|
|||||||
|
|
||||||
existNounPhrase : NounPhrase -> Clause ;
|
existNounPhrase : NounPhrase -> Clause ;
|
||||||
|
|
||||||
|
-- To add a symbol, such as a variable or variable list, to the end of
|
||||||
|
-- an NP.
|
||||||
|
|
||||||
|
addSymbNounPhrase : NounPhrase -> Str -> NounPhrase = \np,x ->
|
||||||
|
{s = \\c => np.s ! c ++ x ;
|
||||||
|
g = np.g ;
|
||||||
|
n = np.n ;
|
||||||
|
p = np.p ;
|
||||||
|
c = np.c
|
||||||
|
} ;
|
||||||
|
|
||||||
|
|
||||||
--2 Determiners
|
--2 Determiners
|
||||||
--
|
--
|
||||||
|
|||||||
58
resource/scandinavian/MathScand.gf
Normal file
58
resource/scandinavian/MathScand.gf
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
--# -path=.:../abstract:../../prelude
|
||||||
|
|
||||||
|
incomplete concrete MathScand of Math = CategoriesScand **
|
||||||
|
open Prelude, SyntaxScand in {
|
||||||
|
|
||||||
|
lin
|
||||||
|
SymbPN i = {s = \\_ => i.s ; g = NNeutr} ; --- cannot know gender
|
||||||
|
IntPN i = {s = \\_ => i.s ; g = NNeutr} ;
|
||||||
|
IntNP cn i = nameNounPhrase {
|
||||||
|
s = \\c => cn.s ! Sg ! DefP Def ! Nom ++ i.s ;
|
||||||
|
g = cn.g
|
||||||
|
} ;
|
||||||
|
|
||||||
|
IndefSymbNumNP nu cn xs =
|
||||||
|
addSymbNounPhrase (indefNounPhraseNum plural nu cn) xs.s ;
|
||||||
|
DefSymbNumNP nu cn xs =
|
||||||
|
addSymbNounPhrase (defNounPhraseNum plural nu cn) xs.s ;
|
||||||
|
NDetSymbNP det nu cn xs =
|
||||||
|
addSymbNounPhrase (numDetNounPhrase det nu cn) xs.s ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
SymbList = SS ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
SymbTwo = infixSS conjEt ;
|
||||||
|
SymbMore = infixSS "," ;
|
||||||
|
|
||||||
|
|
||||||
|
LetCN x cn = {
|
||||||
|
s = \\_ => letImp ++ x.s ++ verbVara.s ! VI (Inf Act) ++ (indefNounPhrase singular cn).s !
|
||||||
|
PNom
|
||||||
|
} ;
|
||||||
|
LetNumCN x nu cn = {
|
||||||
|
s = \\_ => letImp ++ x.s ++ verbVara.s ! VI (Inf Act) ++
|
||||||
|
(indefNounPhraseNum plural nu cn).s
|
||||||
|
! PNom
|
||||||
|
} ;
|
||||||
|
|
||||||
|
--- to be replaced by "det existerar", etc.
|
||||||
|
|
||||||
|
ExistNP np = predVerbGroupClause npDet
|
||||||
|
(complTransVerb (mkDirectVerb (deponentVerb verbFinnas))
|
||||||
|
np) ;
|
||||||
|
|
||||||
|
-- Moved from $RulesScand$.
|
||||||
|
|
||||||
|
SymbCN cn s =
|
||||||
|
{s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ;
|
||||||
|
g = cn.g ;
|
||||||
|
p = cn.p
|
||||||
|
} ;
|
||||||
|
IntCN cn s =
|
||||||
|
{s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ;
|
||||||
|
g = cn.g ;
|
||||||
|
p = cn.p
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -10,16 +10,13 @@ lin
|
|||||||
UsePN = nameNounPhrase ;
|
UsePN = nameNounPhrase ;
|
||||||
|
|
||||||
SymbPN i = {s = \\_ => i.s ; g = NNeutr} ;
|
SymbPN i = {s = \\_ => i.s ; g = NNeutr} ;
|
||||||
|
|
||||||
SymbCN cn s =
|
SymbCN cn s =
|
||||||
{s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ;
|
{s = \\n => cn.s ! n ++ s.s ;
|
||||||
g = cn.g ;
|
g = cn.g} ;
|
||||||
p = cn.p
|
IntCN cn i =
|
||||||
} ;
|
{s = \\n => cn.s ! n ++ i.s ;
|
||||||
IntCN cn s =
|
g = cn.g} ;
|
||||||
{s = \\a,n,c => cn.s ! a ! n ! c ++ s.s ;
|
|
||||||
g = cn.g ;
|
|
||||||
p = cn.p
|
|
||||||
} ;
|
|
||||||
|
|
||||||
IndefOneNP = indefNounPhrase singular ;
|
IndefOneNP = indefNounPhrase singular ;
|
||||||
IndefNumNP = indefNounPhraseNum plural ;
|
IndefNumNP = indefNounPhraseNum plural ;
|
||||||
|
|||||||
@@ -122,6 +122,11 @@ oper
|
|||||||
|
|
||||||
npDet : NounPhrase ;
|
npDet : NounPhrase ;
|
||||||
|
|
||||||
|
|
||||||
|
addSymbNounPhrase : NounPhrase -> Str -> NounPhrase = \np,x ->
|
||||||
|
{s = \\c => np.s ! c ++ x ; g = np.g ; n = np.n ; p = np.p} ;
|
||||||
|
|
||||||
|
|
||||||
--2 Determiners
|
--2 Determiners
|
||||||
--
|
--
|
||||||
-- Determiners are inflected according to noun in gender and sex.
|
-- Determiners are inflected according to noun in gender and sex.
|
||||||
@@ -1710,4 +1715,7 @@ oper
|
|||||||
|
|
||||||
pronVars, pronVem, pronVems : Str ;
|
pronVars, pronVem, pronVems : Str ;
|
||||||
|
|
||||||
|
conjEt : Str ;
|
||||||
|
|
||||||
|
letImp : Str = "låt" ; ---- check for all scand
|
||||||
} ;
|
} ;
|
||||||
|
|||||||
4
resource/spanish/MathSpa.gf
Normal file
4
resource/spanish/MathSpa.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
--# -path=.:../romance:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete MathSpa of Math = CategoriesSpa **
|
||||||
|
MathRomance with (SyntaxRomance=SyntaxSpa) ;
|
||||||
4
resource/swedish/MathSwe.gf
Normal file
4
resource/swedish/MathSwe.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
--# -path=.:../scandinavian:../abstract:../../prelude
|
||||||
|
|
||||||
|
concrete MathSwe of Math = CategoriesSwe **
|
||||||
|
MathScand with (SyntaxScand=SyntaxSwe) ;
|
||||||
@@ -132,4 +132,7 @@ instance SyntaxSwe of SyntaxScand = TypesSwe **
|
|||||||
CPpå => "på" ;
|
CPpå => "på" ;
|
||||||
CPtill => "till"
|
CPtill => "till"
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
conjEt = "och" ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user