cardinal numbers in Slovenian

This commit is contained in:
krasimir
2016-05-03 08:56:50 +00:00
parent 8a2d41d89f
commit 9bb33b7610
5 changed files with 38 additions and 17 deletions

View File

@@ -16,10 +16,14 @@ lincat
Pron = {s : Case => Str ; a : Agr} ; Pron = {s : Case => Str ; a : Agr} ;
Det = {s : Case => Str; spec : Species; n : Number} ; Det = {s : Gender => Case => Str; spec : Species; n : NumAgr} ;
Num = {s : Case => Str ; n : Number} ; Num = {s : Gender => Case => Str ; n : NumAgr} ;
Card = {s : Gender => Case => Str ; n : NumAgr} ;
Quant = {s : Str; spec : Species} ; Quant = {s : Str; spec : Species} ;
-- Numeral
Numeral = {s : Gender => Case => Str ; n : NumAgr} ;
-- Structural -- Structural
Prep = {s : Str; c : Case} ; Prep = {s : Str; c : Case} ;

View File

@@ -4,18 +4,17 @@ concrete GrammarSlv of Grammar =
NounSlv, NounSlv,
VerbSlv, VerbSlv,
AdjectiveSlv, AdjectiveSlv,
{- AdverbEng, {- AdverbSlv,-}
NumeralEng, NumeralSlv,
-}
SentenceSlv, SentenceSlv,
{- QuestionEng, {- QuestionSlv,
RelativeEng, RelativeSlv,
ConjunctionEng,-} ConjunctionSlv,-}
PhraseSlv, PhraseSlv,
TextX - [Pol,PPos,PNeg], TextX - [Pol,PPos,PNeg],
StructuralSlv StructuralSlv,
{- IdiomEng, {- IdiomSlv, -}
TenseX -} TenseX
** { ** {
flags startcat = Phr ; unlexer = text ; lexer = text ; flags startcat = Phr ; unlexer = text ; lexer = text ;

View File

@@ -2,20 +2,34 @@ concrete NounSlv of Noun = CatSlv ** open ResSlv in {
lin lin
DetCN det cn = { DetCN det cn = {
s = \\c => det.s ! c ++ cn.s ! det.spec ! c ! det.n ; s = \\c => det.s ! cn.g ! c ++
a = {g=cn.g; n=det.n; p=P3} case det.n of {
UseNum n => cn.s ! det.spec ! c ! n ;
UseGen => cn.s ! det.spec ! Gen ! Pl
} ;
a = {g = cn.g ;
n = case det.n of {
UseNum n => n ;
UseGen => Pl
} ;
p = P3
}
} ; } ;
UsePron p = p ; UsePron p = p ;
DetQuant quant num = { DetQuant quant num = {
s = \\c => quant.s ++ num.s ! c; s = \\c,g => quant.s ++ num.s ! c ! g;
spec = quant.spec ; spec = quant.spec ;
n = num.n ; n = num.n ;
} ; } ;
NumSg = {s = \\_ => []; n = Sg} ; NumSg = {s = \\_,_ => []; n = UseNum Sg} ;
NumPl = {s = \\_ => []; n = Pl} ; NumPl = {s = \\_,_ => []; n = UseNum Pl} ;
NumCard n = n ;
NumNumeral numeral = {s = numeral.s; n = numeral.n} ;
DefArt = { DefArt = {
s = "" ; s = "" ;

View File

@@ -7,6 +7,7 @@ concrete PhraseSlv of Phrase = CatSlv ** open Prelude, ResSlv in {
UttNP np = {s = np.s ! Nom} ; UttNP np = {s = np.s ! Nom} ;
UttAdv adv = adv ; UttAdv adv = adv ;
UttCN n = {s = n.s ! Indef ! Nom ! Sg} ; UttCN n = {s = n.s ! Indef ! Nom ! Sg} ;
UttCard n = {s = n.s ! Fem ! Nom} ;
UttAP ap = {s = ap.s ! Indef ! Masc ! Nom ! Sg} ; UttAP ap = {s = ap.s ! Indef ! Masc ! Nom ! Sg} ;
UttInterj i = i ; UttInterj i = i ;

View File

@@ -6,7 +6,10 @@ param
Gender = Masc | Fem | Neut ; Gender = Masc | Fem | Neut ;
Person = P1 | P2 | P3 ; Person = P1 | P2 | P3 ;
Species = Indef | Def ; Species = Indef | Def ;
NumAgr = UseNum Number | UseGen;
DForm = Unit Gender | Teen | Ten | Hundred;
VForm = VInf VForm = VInf
| VSup | VSup
| VPastPart Gender Number | VPastPart Gender Number