multimodal for Swedish

This commit is contained in:
aarne
2005-12-09 16:28:45 +00:00
parent 5889b3f7db
commit ea5639b85f
17 changed files with 120 additions and 12 deletions

View 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 ;
}

View File

@@ -1,4 +1,4 @@
resource ParamX = {
resource ParamX = open Prelude in {
param
Number = Sg | Pl ;
@@ -26,10 +26,10 @@ resource ParamX = {
-- 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 {
Pos => true ;
Neg => false
Pos => true.s ;
Neg => false.s
}
} ;

View 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 "," ;
}

View File

@@ -23,7 +23,10 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
in
mkDem
{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 =
let cl = QuestCl (PredVP np vp)
@@ -31,8 +34,8 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
mkDem
{s : Polarity => Str}
(polCases
((PosQCl cl).s ! QDir)
((NegQCl cl).s ! QDir))
(UttQS (PosQCl cl))
(UttQS (NegQCl cl)))
(concatPoint np vp) ;
MQuestVP np vp =
@@ -41,8 +44,8 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
mkDem
{s : Polarity => Str}
(polCases
((PosQCl cl).s ! QDir)
((NegQCl cl).s ! QDir))
(UttQS (PosQCl cl))
(UttQS (NegQCl cl)))
vp ;
MImpVP vp =
@@ -51,8 +54,8 @@ incomplete concrete DemonstrativeI of Demonstrative = Cat, TenseX **
mkDem
{s : Polarity => Str}
(polCases
((UttImpSg PPos imp).s)
((UttImpSg PNeg imp).s))
((UttImpSg PPos imp))
((UttImpSg PNeg imp)))
vp ;

View File

@@ -0,0 +1,4 @@
concrete DemonstrativeSwe of Demonstrative = CatSwe, TenseX ** DemonstrativeI with
(Test = TestSwe),
(Structural = StructuralSwe) ;

View 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
** {} ;

View File

@@ -18,6 +18,7 @@ interface DiffScand = open ResScand, Prelude in {
conjThat : Str ;
conjThan : Str ;
conjAnd : Str ;
infMark : Str ;
subjIf : Str ;

View 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 "," ;
}

View File

@@ -26,7 +26,7 @@ incomplete concrete VerbScand of Verb = CatScand ** open DiffScand, ResScand in
CompAdv a = {s = \\_ => a.s} ;
--- 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 ;
{-

View File

@@ -22,6 +22,7 @@ instance DiffSwe of DiffScand = open ResScand, Prelude in {
conjThat = "att" ;
conjThan = "än" ;
conjAnd = "och" ;
infMark = "att" ;
subjIf = "om" ;

View File

@@ -0,0 +1,2 @@
concrete MathSwe of Math = CatSwe ** MathScand with
(DiffScand = DiffSwe) ;