mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-21 00:52:51 -06:00
Math to mathematical/Symbol
This commit is contained in:
31
lib/resource-1.0/mathematical/Symbol.gf
Normal file
31
lib/resource-1.0/mathematical/Symbol.gf
Normal file
@@ -0,0 +1,31 @@
|
||||
--1 Symbolic expressions
|
||||
|
||||
-- *Note*. This module is not automatically included in the main
|
||||
-- grammar [Lang Lang.html].
|
||||
|
||||
abstract Symbol = Cat ** {
|
||||
|
||||
--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 ;
|
||||
|
||||
}
|
||||
26
lib/resource-1.0/mathematical/SymbolEng.gf
Normal file
26
lib/resource-1.0/mathematical/SymbolEng.gf
Normal file
@@ -0,0 +1,26 @@
|
||||
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
|
||||
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, SymbList = SS ;
|
||||
|
||||
lin
|
||||
|
||||
MkSymb s = s ;
|
||||
|
||||
BaseSymb = infixSS "and" ;
|
||||
ConsSymb = infixSS "," ;
|
||||
|
||||
}
|
||||
2
lib/resource-1.0/mathematical/SymbolFre.gf
Normal file
2
lib/resource-1.0/mathematical/SymbolFre.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete SymbolFre of Symbol = CatFre ** SymbolRomance with
|
||||
(ResRomance = ResFre) ;
|
||||
28
lib/resource-1.0/mathematical/SymbolGer.gf
Normal file
28
lib/resource-1.0/mathematical/SymbolGer.gf
Normal file
@@ -0,0 +1,28 @@
|
||||
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
|
||||
{-
|
||||
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, SymbList = SS ;
|
||||
|
||||
lin
|
||||
|
||||
MkSymb s = s ;
|
||||
|
||||
BaseSymb = infixSS "und" ;
|
||||
ConsSymb = infixSS "," ;
|
||||
|
||||
}
|
||||
|
||||
30
lib/resource-1.0/mathematical/SymbolRomance.gf
Normal file
30
lib/resource-1.0/mathematical/SymbolRomance.gf
Normal file
@@ -0,0 +1,30 @@
|
||||
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} ;
|
||||
|
||||
{-
|
||||
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 ! g ++ cn.s ! det.n ! det.det ! caseNP c ++ xs.s ;
|
||||
a = agrP3 g det.n
|
||||
} ;
|
||||
-}
|
||||
|
||||
lincat
|
||||
|
||||
Symb, SymbList = SS ;
|
||||
|
||||
lin
|
||||
|
||||
MkSymb s = s ;
|
||||
|
||||
BaseSymb = infixSS "et" ; ----
|
||||
ConsSymb = infixSS "," ;
|
||||
|
||||
}
|
||||
27
lib/resource-1.0/mathematical/SymbolScand.gf
Normal file
27
lib/resource-1.0/mathematical/SymbolScand.gf
Normal file
@@ -0,0 +1,27 @@
|
||||
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
|
||||
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, SymbList = SS ;
|
||||
|
||||
lin
|
||||
|
||||
MkSymb s = s ;
|
||||
|
||||
BaseSymb = infixSS conjAnd ;
|
||||
ConsSymb = infixSS "," ;
|
||||
|
||||
}
|
||||
2
lib/resource-1.0/mathematical/SymbolSwe.gf
Normal file
2
lib/resource-1.0/mathematical/SymbolSwe.gf
Normal file
@@ -0,0 +1,2 @@
|
||||
concrete SymbolSwe of Symbol = CatSwe ** SymbolScand with
|
||||
(ResScand = ResSwe) ;
|
||||
Reference in New Issue
Block a user