mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 03:32:51 -06:00
took back smart type of Int ; Digits type in resource and some adjustments of Det syntax (not yet for romance and russian)
This commit is contained in:
@@ -56,15 +56,16 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
|
||||
isPoss : Bool ; -- True (a possessive suffix is present)
|
||||
isDef : Bool -- True (verb agrees in Pl, Nom is not Part)
|
||||
} ;
|
||||
QuantSg, QuantPl = {s1 : Case => Str ; s2 : Str ; isPoss, isDef : Bool} ;
|
||||
---- QuantSg, QuantPl = {s1 : Case => Str ; s2 : Str ; isPoss, isDef : Bool} ;
|
||||
Ord = {s : Number => Case => Str} ;
|
||||
Predet = {s : Number => NPForm => Str} ;
|
||||
Quant = {s1 : Number => Case => Str ; s2 : Str ; isPoss, isDef : Bool} ;
|
||||
Num = {s : Number => Case => Str ; isNum : Bool} ;
|
||||
Num = {s : Number => Case => Str ; isNum : Bool ; n : Number} ;
|
||||
|
||||
-- Numeral
|
||||
|
||||
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||
Digits = {s : CardOrd => Str ; n : Number} ;
|
||||
|
||||
-- Structural
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
||||
} ;
|
||||
|
||||
DetSg quant ord = {
|
||||
s1 = \\c => quant.s1 ! c ++ ord.s ! Sg ! c ;
|
||||
s1 = \\c => quant.s1 ! Sg ! c ++ ord.s ! Sg ! c ;
|
||||
s2 = quant.s2 ;
|
||||
n = Sg ;
|
||||
isNum = False ;
|
||||
@@ -70,14 +70,15 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
||||
} ;
|
||||
|
||||
DetPl quant num ord = {
|
||||
s1 = \\c => quant.s1 ! c ++ num.s ! Sg ! c ++ ord.s ! Pl ! c ;
|
||||
s1 = \\c => quant.s1 ! num.n ! c ++ num.s ! Sg ! c ++ ord.s ! Pl ! c ;
|
||||
s2 = quant.s2 ;
|
||||
n = Pl ;
|
||||
n = num.n ;
|
||||
isNum = num.isNum ;
|
||||
isPoss = quant.isPoss ;
|
||||
isDef = quant.isDef
|
||||
} ;
|
||||
|
||||
{- --- DEPREC
|
||||
SgQuant quant = {
|
||||
s1 = quant.s1 ! Sg ;
|
||||
s2 = quant.s2 ;
|
||||
@@ -92,7 +93,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
||||
isPoss = quant.isPoss ;
|
||||
isDef = quant.isDef
|
||||
} ;
|
||||
|
||||
-}
|
||||
PossPron p = {
|
||||
s1 = \\_,_ => p.s ! NPCase Gen ;
|
||||
s2 = BIND ++ possSuffix p.a ;
|
||||
@@ -101,16 +102,27 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
||||
isDef = True --- "minun kolme autoani ovat" ; thus "...on" is missing
|
||||
} ;
|
||||
|
||||
NoNum = {s = \\_,_ => [] ; isNum = False} ;
|
||||
NoNum = {s = \\_,_ => [] ; isNum = False ; n = Pl} ;
|
||||
NoOrd = {s = \\_,_ => []} ;
|
||||
|
||||
NumInt n = {s = \\_,_ => n.s ; isNum = True} ;
|
||||
NumInt n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ; --DEPREC
|
||||
OrdInt n = {s = \\_,_ => n.s ++ "."} ;
|
||||
|
||||
NumNumeral numeral = {s = \\n,c => numeral.s ! NCard (NCase n c) ; isNum = True} ;
|
||||
NumDigits numeral = {
|
||||
s = \\n,c => numeral.s ! NCard (NCase n c) ;
|
||||
n = numeral.n ;
|
||||
isNum = True
|
||||
} ;
|
||||
OrdDigits numeral = {s = \\n,c => numeral.s ! NOrd (NCase n c)} ;
|
||||
|
||||
NumNumeral numeral = {
|
||||
s = \\n,c => numeral.s ! NCard (NCase n c) ;
|
||||
n = numeral.n ;
|
||||
isNum = True
|
||||
} ;
|
||||
OrdNumeral numeral = {s = \\n,c => numeral.s ! NOrd (NCase n c)} ;
|
||||
|
||||
AdNum adn num = {s = \\n,c => adn.s ++ num.s ! n ! c ; isNum = num.isNum} ;
|
||||
AdNum adn num = {s = \\n,c => adn.s ++ num.s ! n ! c ; isNum = num.isNum ; n = num.n} ;
|
||||
|
||||
OrdSuperl a = {s = \\n,c => a.s ! Superl ! AN (NCase n c)} ;
|
||||
|
||||
@@ -128,7 +140,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
||||
} ;
|
||||
|
||||
MassDet = {
|
||||
s1 = \\_ => [] ; --- Nom is Part ?
|
||||
s1 = \\_,_ => [] ; --- Nom is Part ?
|
||||
s2 = [] ;
|
||||
isNum,isPoss,isDef = False
|
||||
} ;
|
||||
|
||||
@@ -138,5 +138,42 @@ oper
|
||||
}
|
||||
} ;
|
||||
|
||||
|
||||
lincat
|
||||
Dig = TDigit ;
|
||||
|
||||
lin
|
||||
IDig d = d ;
|
||||
|
||||
IIDig d i = {
|
||||
s = \\o => d.s ! o ++ i.s ! o ;
|
||||
n = Pl
|
||||
} ;
|
||||
|
||||
D_0 = mkDig "0" ;
|
||||
D_1 = mk3Dig "1" "1." MorphoFin.Sg ;
|
||||
D_2 = mkDig "2" ;
|
||||
D_3 = mkDig "3" ;
|
||||
D_4 = mkDig "4" ;
|
||||
D_5 = mkDig "5" ;
|
||||
D_6 = mkDig "6" ;
|
||||
D_7 = mkDig "7" ;
|
||||
D_8 = mkDig "8" ;
|
||||
D_9 = mkDig "9" ;
|
||||
|
||||
oper
|
||||
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o MorphoFin.Pl ;
|
||||
mkDig : Str -> TDigit = \c -> mk2Dig c (c + ".") ;
|
||||
|
||||
mk3Dig : Str -> Str -> MorphoFin.Number -> TDigit = \c,o,n -> {
|
||||
s = table {NCard _ => c ; NOrd _ => o} ;
|
||||
n = n
|
||||
} ;
|
||||
|
||||
TDigit = {
|
||||
n : MorphoFin.Number ;
|
||||
s : CardOrd => Str
|
||||
} ;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ concrete StructuralFin of Structural = CatFin **
|
||||
{lock_N = <>}) Sg ;
|
||||
everywhere_Adv = ss "kaikkialla" ;
|
||||
few_Det = mkDet Sg (regN "harva") ;
|
||||
first_Ord = {s = \\n,c => (regN "ensimmäinen").s ! NCase n c} ;
|
||||
--- first_Ord = {s = \\n,c => (regN "ensimmäinen").s ! NCase n c} ;
|
||||
for_Prep = casePrep allative ;
|
||||
from_Prep = casePrep elative ;
|
||||
he_Pron = mkPronoun "hän" "hänen" "häntä" "hänenä" "häneen" Sg P3 ;
|
||||
@@ -65,9 +65,7 @@ concrete StructuralFin of Structural = CatFin **
|
||||
must_VV = subjcaseV (regV "täytyä") genitive ;
|
||||
no_Phr = ss "ei" ;
|
||||
on_Prep = casePrep adessive ;
|
||||
one_Quant = mkDet Sg
|
||||
(nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi"
|
||||
"yksien" "yksiä" "yksiin")) ;
|
||||
--- one_Quant = mkDet Sg DEPREC
|
||||
only_Predet = {s = \\_,_ => "vain"} ;
|
||||
or_Conj = ss "tai" ** {n = Sg} ;
|
||||
otherwise_PConj = ss "muuten" ;
|
||||
|
||||
Reference in New Issue
Block a user