mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 19:42:50 -06:00
multimodal for Swedish
This commit is contained in:
25
lib/resource-1.0/abstract/Math.gf
Normal file
25
lib/resource-1.0/abstract/Math.gf
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
abstract Math = Cat ** {
|
||||||
|
|
||||||
|
--3 Noun phrases with symbols
|
||||||
|
|
||||||
|
fun
|
||||||
|
|
||||||
|
SymbPN : Symb -> PN ; -- "x"
|
||||||
|
IntPN : Int -> PN ; -- "27"
|
||||||
|
CNIntNP : CN -> Int -> NP ; -- "level 53"
|
||||||
|
CNSymbNP : Det -> CN -> [Symb] -> NP ; -- "(the) (2) numbers x and y"
|
||||||
|
|
||||||
|
--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
|
||||||
|
Symb ;
|
||||||
|
[Symb]{2} ;
|
||||||
|
|
||||||
|
fun
|
||||||
|
MkSymb : String -> Symb ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
resource ParamX = {
|
resource ParamX = open Prelude in {
|
||||||
|
|
||||||
param
|
param
|
||||||
Number = Sg | Pl ;
|
Number = Sg | Pl ;
|
||||||
@@ -26,10 +26,10 @@ resource ParamX = {
|
|||||||
|
|
||||||
-- To construct a record with a polarity-dependent table.
|
-- To construct a record with a polarity-dependent table.
|
||||||
|
|
||||||
polCases : Str -> Str -> {s : Polarity => Str} = \true,false -> {
|
polCases : SS -> SS -> {s : Polarity => Str} = \true,false -> {
|
||||||
s = table {
|
s = table {
|
||||||
Pos => true ;
|
Pos => true.s ;
|
||||||
Neg => false
|
Neg => false.s
|
||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
26
lib/resource-1.0/english/MathEng.gf
Normal file
26
lib/resource-1.0/english/MathEng.gf
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
concrete MathEng of Math = 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 "," ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -23,7 +23,10 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
|
|||||||
in
|
in
|
||||||
mkDem
|
mkDem
|
||||||
{s : Polarity => Str}
|
{s : Polarity => Str}
|
||||||
(polCases (PosCl cl).s (NegCl cl).s) (concatPoint np vp) ;
|
(polCases
|
||||||
|
(UttS (PosCl cl))
|
||||||
|
(UttS (NegCl cl)))
|
||||||
|
(concatPoint np vp) ;
|
||||||
|
|
||||||
MQPredVP np vp =
|
MQPredVP np vp =
|
||||||
let cl = QuestCl (PredVP np vp)
|
let cl = QuestCl (PredVP np vp)
|
||||||
@@ -31,8 +34,8 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
|
|||||||
mkDem
|
mkDem
|
||||||
{s : Polarity => Str}
|
{s : Polarity => Str}
|
||||||
(polCases
|
(polCases
|
||||||
((PosQCl cl).s ! QDir)
|
(UttQS (PosQCl cl))
|
||||||
((NegQCl cl).s ! QDir))
|
(UttQS (NegQCl cl)))
|
||||||
(concatPoint np vp) ;
|
(concatPoint np vp) ;
|
||||||
|
|
||||||
MQuestVP np vp =
|
MQuestVP np vp =
|
||||||
@@ -41,8 +44,8 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
|
|||||||
mkDem
|
mkDem
|
||||||
{s : Polarity => Str}
|
{s : Polarity => Str}
|
||||||
(polCases
|
(polCases
|
||||||
((PosQCl cl).s ! QDir)
|
(UttQS (PosQCl cl))
|
||||||
((NegQCl cl).s ! QDir))
|
(UttQS (NegQCl cl)))
|
||||||
vp ;
|
vp ;
|
||||||
|
|
||||||
MImpVP vp =
|
MImpVP vp =
|
||||||
@@ -51,8 +54,8 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
|
|||||||
mkDem
|
mkDem
|
||||||
{s : Polarity => Str}
|
{s : Polarity => Str}
|
||||||
(polCases
|
(polCases
|
||||||
((UttImpSg PPos imp).s)
|
((UttImpSg PPos imp))
|
||||||
((UttImpSg PNeg imp).s))
|
((UttImpSg PNeg imp)))
|
||||||
vp ;
|
vp ;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
lib/resource-1.0/multimodal/DemonstrativeSwe.gf
Normal file
4
lib/resource-1.0/multimodal/DemonstrativeSwe.gf
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
concrete DemonstrativeSwe of Demonstrative = CatSwe, TenseX ** DemonstrativeI with
|
||||||
|
(Test = TestSwe),
|
||||||
|
(Structural = StructuralSwe) ;
|
||||||
|
|
||||||
19
lib/resource-1.0/multimodal/MultimodalSwe.gf
Normal file
19
lib/resource-1.0/multimodal/MultimodalSwe.gf
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
--# -path=.:../swedish/:../scandinavian:../abstract:../common:prelude
|
||||||
|
|
||||||
|
concrete MultimodalSwe of Multimodal =
|
||||||
|
NounSwe,
|
||||||
|
-- Verb,
|
||||||
|
AdjectiveSwe,
|
||||||
|
AdverbSwe,
|
||||||
|
NumeralSwe,
|
||||||
|
-- Sentence,
|
||||||
|
-- Question,
|
||||||
|
-- Relative,
|
||||||
|
-- Conjunction,
|
||||||
|
-- Phrase,
|
||||||
|
-- Tensed,
|
||||||
|
StructuralSwe,
|
||||||
|
DemonstrativeSwe,
|
||||||
|
BasicSwe
|
||||||
|
** {} ;
|
||||||
|
|
||||||
@@ -18,6 +18,7 @@ interface DiffScand = open ResScand, Prelude in {
|
|||||||
|
|
||||||
conjThat : Str ;
|
conjThat : Str ;
|
||||||
conjThan : Str ;
|
conjThan : Str ;
|
||||||
|
conjAnd : Str ;
|
||||||
infMark : Str ;
|
infMark : Str ;
|
||||||
|
|
||||||
subjIf : Str ;
|
subjIf : Str ;
|
||||||
|
|||||||
27
lib/resource-1.0/scandinavian/MathScand.gf
Normal file
27
lib/resource-1.0/scandinavian/MathScand.gf
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
incomplete concrete MathScand of Math =
|
||||||
|
CatScand ** open Prelude, ResScand, DiffScand 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 ! 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 "," ;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -26,7 +26,7 @@ incomplete concrete VerbScand of Verb = CatScand ** open DiffScand, ResScand in
|
|||||||
CompAdv a = {s = \\_ => a.s} ;
|
CompAdv a = {s = \\_ => a.s} ;
|
||||||
|
|
||||||
--- these give parser overflow
|
--- these give parser overflow
|
||||||
--- AdvVP vp adv = insertAdv adv.s vp ;
|
AdvVP vp adv = insertAdv adv.s vp ;
|
||||||
--- AdVVP adv vp = insertAdV adv.s vp ;
|
--- AdVVP adv vp = insertAdV adv.s vp ;
|
||||||
|
|
||||||
{-
|
{-
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ instance DiffSwe of DiffScand = open ResScand, Prelude in {
|
|||||||
|
|
||||||
conjThat = "att" ;
|
conjThat = "att" ;
|
||||||
conjThan = "än" ;
|
conjThan = "än" ;
|
||||||
|
conjAnd = "och" ;
|
||||||
infMark = "att" ;
|
infMark = "att" ;
|
||||||
|
|
||||||
subjIf = "om" ;
|
subjIf = "om" ;
|
||||||
|
|||||||
2
lib/resource-1.0/swedish/MathSwe.gf
Normal file
2
lib/resource-1.0/swedish/MathSwe.gf
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
concrete MathSwe of Math = CatSwe ** MathScand with
|
||||||
|
(DiffScand = DiffSwe) ;
|
||||||
Reference in New Issue
Block a user