mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-31 02:38:55 -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:
@@ -78,9 +78,7 @@ abstract Cat = Common ** {
|
|||||||
Pron ; -- personal pronoun e.g. "she"
|
Pron ; -- personal pronoun e.g. "she"
|
||||||
Det ; -- determiner phrase e.g. "those seven"
|
Det ; -- determiner phrase e.g. "those seven"
|
||||||
Predet ; -- predeterminer (prefixed Quant) e.g. "all"
|
Predet ; -- predeterminer (prefixed Quant) e.g. "all"
|
||||||
QuantSg ;-- quantifier ('nucleus' of sing. Det) e.g. "every"
|
Quant ; -- quantifier ('nucleus' of Det) e.g. "this/these"
|
||||||
QuantPl ;-- quantifier ('nucleus' of plur. Det) e.g. "many"
|
|
||||||
Quant ; -- quantifier with both sg and pl e.g. "this/these"
|
|
||||||
Num ; -- cardinal number (used with QuantPl) e.g. "seven"
|
Num ; -- cardinal number (used with QuantPl) e.g. "seven"
|
||||||
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
Ord ; -- ordinal number (used in Det) e.g. "seventh"
|
||||||
|
|
||||||
@@ -89,6 +87,7 @@ abstract Cat = Common ** {
|
|||||||
-- Constructed in [Numeral Numeral.html].
|
-- Constructed in [Numeral Numeral.html].
|
||||||
|
|
||||||
Numeral ; -- cardinal or ordinal, e.g. "five/fifth"
|
Numeral ; -- cardinal or ordinal, e.g. "five/fifth"
|
||||||
|
Digits ; -- cardinal or ordinal, e.g. "1,000/1,000th"
|
||||||
|
|
||||||
--2 Structural words
|
--2 Structural words
|
||||||
|
|
||||||
@@ -121,4 +120,8 @@ abstract Cat = Common ** {
|
|||||||
N3 ; -- three-place relational noun e.g. "connection"
|
N3 ; -- three-place relational noun e.g. "connection"
|
||||||
PN ; -- proper name e.g. "Paris"
|
PN ; -- proper name e.g. "Paris"
|
||||||
|
|
||||||
|
-- DEPRECATED: QuantSg, QuantPl
|
||||||
|
--- QuantSg ;-- quantifier ('nucleus' of sing. Det) e.g. "every"
|
||||||
|
--- QuantPl ;-- quantifier ('nucleus' of plur. Det) e.g. "many"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,13 +35,17 @@ abstract Noun = Cat ** {
|
|||||||
-- (This is modified from CLE by further dividing their $Num$ into
|
-- (This is modified from CLE by further dividing their $Num$ into
|
||||||
-- cardinal and ordinal.)
|
-- cardinal and ordinal.)
|
||||||
|
|
||||||
DetSg : QuantSg -> Ord -> Det ; -- this best man
|
DetSg : Quant -> Ord -> Det ; -- this best man
|
||||||
DetPl : QuantPl -> Num -> Ord -> Det ; -- these five best men
|
DetPl : Quant -> Num -> Ord -> Det ; -- these five best men
|
||||||
|
|
||||||
|
-- Notice that $DetPl$ can still result in a singular determiner, because
|
||||||
|
-- "one" is a numeral: "this one man".
|
||||||
|
|
||||||
-- Quantifiers that have both forms can be used in both ways.
|
-- Quantifiers that have both forms can be used in both ways.
|
||||||
|
|
||||||
SgQuant : Quant -> QuantSg ; -- this
|
--- DEPRECATED: no longer needed
|
||||||
PlQuant : Quant -> QuantPl ; -- these
|
--- SgQuant : Quant -> QuantSg ; -- this
|
||||||
|
--- PlQuant : Quant -> QuantPl ; -- these
|
||||||
|
|
||||||
-- Pronouns have possessive forms. Genitives of other kinds
|
-- Pronouns have possessive forms. Genitives of other kinds
|
||||||
-- of noun phrases are not given here, since they are not possible
|
-- of noun phrases are not given here, since they are not possible
|
||||||
@@ -58,7 +62,8 @@ abstract Noun = Cat ** {
|
|||||||
|
|
||||||
-- $Num$ consists of either digits or numeral words.
|
-- $Num$ consists of either digits or numeral words.
|
||||||
|
|
||||||
NumInt : Int -> Num ; -- 51
|
NumInt : Int -> Num ; -- 51 (DEPRECATED)
|
||||||
|
NumDigits : Digits -> Num ; -- 51
|
||||||
NumNumeral : Numeral -> Num ; -- fifty-one
|
NumNumeral : Numeral -> Num ; -- fifty-one
|
||||||
|
|
||||||
-- The construction of numerals is defined in [Numeral Numeral.html].
|
-- The construction of numerals is defined in [Numeral Numeral.html].
|
||||||
@@ -69,7 +74,8 @@ abstract Noun = Cat ** {
|
|||||||
|
|
||||||
-- $Ord$ consists of either digits or numeral words.
|
-- $Ord$ consists of either digits or numeral words.
|
||||||
|
|
||||||
OrdInt : Int -> Ord ; -- 51st
|
OrdInt : Int -> Ord ; -- 51st (DEPRECATED)
|
||||||
|
OrdDigits : Digits -> Ord ; -- 51st
|
||||||
OrdNumeral : Numeral -> Ord ; -- fifty-first
|
OrdNumeral : Numeral -> Ord ; -- fifty-first
|
||||||
|
|
||||||
-- Superlative forms of adjectives behave syntactically in the same way as
|
-- Superlative forms of adjectives behave syntactically in the same way as
|
||||||
@@ -88,7 +94,7 @@ abstract Noun = Cat ** {
|
|||||||
-- not distinguish mass nouns from other common nouns, which can result
|
-- not distinguish mass nouns from other common nouns, which can result
|
||||||
-- in semantically odd expressions.
|
-- in semantically odd expressions.
|
||||||
|
|
||||||
MassDet : QuantSg ; -- (beer)
|
MassDet : Quant ; -- (beer)
|
||||||
|
|
||||||
-- Other determiners are defined in [Structural Structural.html].
|
-- Other determiners are defined in [Structural Structural.html].
|
||||||
|
|
||||||
|
|||||||
@@ -46,4 +46,15 @@ fun
|
|||||||
pot3 : Sub1000 -> Sub1000000 ; -- m * 1000
|
pot3 : Sub1000 -> Sub1000000 ; -- m * 1000
|
||||||
pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
|
pot3plus : Sub1000 -> Sub1000 -> Sub1000000 ; -- m * 1000 + n
|
||||||
|
|
||||||
|
-- Numerals as sequences of digits have a separate, simpler grammar
|
||||||
|
|
||||||
|
cat
|
||||||
|
Dig ;
|
||||||
|
|
||||||
|
fun
|
||||||
|
IDig : Dig -> Digits ;
|
||||||
|
IIDig : Dig -> Digits -> Digits ;
|
||||||
|
|
||||||
|
D_0, D_1, D_2, D_3, D_4, D_5, D_6, D_7, D_8, D_9 : Dig ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ abstract Structural = Cat ** {
|
|||||||
everybody_NP : NP ;
|
everybody_NP : NP ;
|
||||||
everything_NP : NP ;
|
everything_NP : NP ;
|
||||||
everywhere_Adv : Adv ;
|
everywhere_Adv : Adv ;
|
||||||
first_Ord : Ord ;
|
--- first_Ord : Ord ; DEPRECATED
|
||||||
few_Det : Det ;
|
few_Det : Det ;
|
||||||
for_Prep : Prep ;
|
for_Prep : Prep ;
|
||||||
from_Prep : Prep ;
|
from_Prep : Prep ;
|
||||||
@@ -59,7 +59,7 @@ abstract Structural = Cat ** {
|
|||||||
must_VV : VV ;
|
must_VV : VV ;
|
||||||
no_Phr : Phr ;
|
no_Phr : Phr ;
|
||||||
on_Prep : Prep ;
|
on_Prep : Prep ;
|
||||||
one_Quant : QuantSg ;
|
--- one_Quant : QuantSg ; DEPRECATED
|
||||||
only_Predet : Predet ;
|
only_Predet : Predet ;
|
||||||
or_Conj : Conj ;
|
or_Conj : Conj ;
|
||||||
otherwise_PConj : PConj ;
|
otherwise_PConj : PConj ;
|
||||||
|
|||||||
@@ -53,4 +53,11 @@ resource ParamX = open Prelude in {
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
-- To count the length of a tail in a sequence of digits, e.g. to put commas
|
||||||
|
-- as in 1,000,000.
|
||||||
|
|
||||||
|
param
|
||||||
|
DTail = T1 | T2 | T3 ;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,12 +44,40 @@ lin n9 = mkTal "ni" "nitten" "halvfems" "niende" "halvfemsindstyvende" ;
|
|||||||
pot3 n = numPl (\\g => n.s ! invNum ++ cardOrd "tusind" "tusinde" ! g) ;
|
pot3 n = numPl (\\g => n.s ! invNum ++ cardOrd "tusind" "tusinde" ! g) ;
|
||||||
pot3plus n m = {s = \\g => n.s ! invNum ++ "tusind" ++ "og" ++ m.s ! g ; n =Pl} ;
|
pot3plus n m = {s = \\g => n.s ! invNum ++ "tusind" ++ "og" ++ m.s ! g ; n =Pl} ;
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
{-
|
|
||||||
lincat
|
lincat
|
||||||
Digit = {s : DForm => CardOrd => Str} ;
|
Dig = TDigit ;
|
||||||
Sub10 = {s : DForm => CardOrd => Str ; n : Number} ;
|
|
||||||
Sub100, Sub1000, Sub1000000 =
|
lin
|
||||||
{s : CardOrd => Str ; n : Number} ;
|
IDig d = d ;
|
||||||
-}
|
|
||||||
|
IIDig d i = {
|
||||||
|
s = \\o => d.s ! o ++ i.s ! o ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
|
||||||
|
D_0 = mkDig "0" ;
|
||||||
|
D_1 = mk3Dig "1" "1e" Sg ;
|
||||||
|
D_2 = mk2Dig "2" "2e" ;
|
||||||
|
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 Pl ;
|
||||||
|
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ;
|
||||||
|
|
||||||
|
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||||
|
s = table {NCard _ => c ; NOrd _ => o} ;
|
||||||
|
n = n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
TDigit = {
|
||||||
|
n : Number ;
|
||||||
|
s : CardOrd => Str
|
||||||
|
} ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ concrete StructuralDan of Structural = CatDan **
|
|||||||
everything_NP = regNP "alt" "alts" SgNeutr ;
|
everything_NP = regNP "alt" "alts" SgNeutr ;
|
||||||
everywhere_Adv = ss "overalt" ;
|
everywhere_Adv = ss "overalt" ;
|
||||||
few_Det = {s = \\_,_ => "få" ; n = Pl ; det = DDef Indef} ;
|
few_Det = {s = \\_,_ => "få" ; n = Pl ; det = DDef Indef} ;
|
||||||
first_Ord = {s = "første" ; isDet = True} ;
|
--- first_Ord = {s = "første" ; isDet = True} ;
|
||||||
for_Prep = ss "for" ;
|
for_Prep = ss "for" ;
|
||||||
from_Prep = ss "fra" ;
|
from_Prep = ss "fra" ;
|
||||||
he_Pron = MorphoDan.mkNP "han" "ham" "hans" "hans" "hans" SgUtr P3 ;
|
he_Pron = MorphoDan.mkNP "han" "ham" "hans" "hans" "hans" SgUtr P3 ;
|
||||||
@@ -53,7 +53,7 @@ concrete StructuralDan of Structural = CatDan **
|
|||||||
mkV "måtte" "må" "må" "måtte" "måttet" "mått" ** {c2 = [] ; lock_VV = <>} ;
|
mkV "måtte" "må" "må" "måtte" "måttet" "mått" ** {c2 = [] ; lock_VV = <>} ;
|
||||||
no_Phr = ss ["Nej"] ;
|
no_Phr = ss ["Nej"] ;
|
||||||
on_Prep = ss "på" ;
|
on_Prep = ss "på" ;
|
||||||
one_Quant = {s = \\_ => genderForms ["en"] ["et"] ; n = Sg ; det = DIndef} ; --- ei
|
--- one_Quant = {s = \\_ => genderForms ["en"] ["et"] ; n = Sg ; det = DIndef} ; --- ei
|
||||||
only_Predet = {s = \\_ => "kun"} ;
|
only_Predet = {s = \\_ => "kun"} ;
|
||||||
or_Conj = ss "eller" ** {n = Sg} ;
|
or_Conj = ss "eller" ** {n = Sg} ;
|
||||||
otherwise_PConj = ss "anderledes" ;
|
otherwise_PConj = ss "anderledes" ;
|
||||||
|
|||||||
@@ -53,13 +53,14 @@ concrete CatEng of Cat = CommonX ** open ResEng, Prelude in {
|
|||||||
CN = {s : Number => Case => Str} ;
|
CN = {s : Number => Case => Str} ;
|
||||||
NP, Pron = {s : Case => Str ; a : Agr} ;
|
NP, Pron = {s : Case => Str ; a : Agr} ;
|
||||||
Det = {s : Str ; n : Number} ;
|
Det = {s : Str ; n : Number} ;
|
||||||
Predet, QuantSg, QuantPl, Ord = {s : Str} ;
|
Predet, Ord = {s : Str} ;
|
||||||
Num = {s : Str; n : Number } ;
|
Num = {s : Str; n : Number } ;
|
||||||
Quant = {s : Number => Str} ;
|
Quant = {s : Number => Str} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|
||||||
Numeral = {s : CardOrd => Str ; n : Number} ;
|
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||||
|
Digits = {s : CardOrd => Str ; n : Number ; tail : DTail} ;
|
||||||
|
|
||||||
-- Structural
|
-- Structural
|
||||||
|
|
||||||
|
|||||||
@@ -26,31 +26,35 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetSg quant ord = {
|
DetSg quant ord = {
|
||||||
s = quant.s ++ ord.s ;
|
s = quant.s ! Sg ++ ord.s ;
|
||||||
n = Sg
|
n = Sg
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetPl quant num ord = {
|
DetPl quant num ord = {
|
||||||
s = quant.s ++ num.s ++ ord.s ;
|
s = quant.s ! num.n ++ num.s ++ ord.s ;
|
||||||
n = num.n
|
n = num.n
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
SgQuant quant = {s = quant.s ! Sg} ;
|
--- SgQuant quant = {s = quant.s ! Sg} ; DEPRECATED
|
||||||
PlQuant quant = {s = quant.s ! Pl} ;
|
--- PlQuant quant = {s = quant.s ! Pl} ;
|
||||||
|
|
||||||
PossPron p = {s = \\_ => p.s ! Gen} ;
|
PossPron p = {s = \\_ => p.s ! Gen} ;
|
||||||
|
|
||||||
NoNum = {s = []; n = Pl } ;
|
NoNum = {s = []; n = Pl } ;
|
||||||
NoOrd = {s = []} ;
|
NoOrd = {s = []} ;
|
||||||
|
|
||||||
NumInt n = {s = n.s; n = table (Predef.Ints 1 * Predef.Ints 9) {
|
NumDigits n = {s = n.s ! NCard ; n = n.n} ;
|
||||||
<0,1> => Sg ;
|
|
||||||
_ => Pl
|
|
||||||
} ! ---- <1,2> ---- parser bug (AR 2/6/2007)
|
|
||||||
<n.size,n.last>
|
|
||||||
} ;
|
|
||||||
|
|
||||||
OrdInt n = {s = n.s ++ "th"} ; ---
|
NumInt n = {s = n.s ; n = Pl} ;
|
||||||
|
--table (Predef.Ints 1 * Predef.Ints 9) {
|
||||||
|
-- <0,1> => Sg ;
|
||||||
|
-- _ => Pl -- DEPRECATED
|
||||||
|
-- } ! <1,2> ---- parser bug (AR 2/6/2007)
|
||||||
|
-- ---- <n.size,n.last>
|
||||||
|
-- } ;
|
||||||
|
|
||||||
|
OrdInt n = {s = n.s ++ "th"} ; --- DEPRECATED
|
||||||
|
OrdDigits n = {s = n.s ! NOrd} ;
|
||||||
|
|
||||||
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ;
|
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n} ;
|
||||||
OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
OrdNumeral numeral = {s = numeral.s ! NOrd} ;
|
||||||
@@ -68,7 +72,7 @@ concrete NounEng of Noun = CatEng ** open ResEng, Prelude in {
|
|||||||
}
|
}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
MassDet = {s = [] ; n = Sg} ;
|
MassDet = {s = \\_ => []} ;
|
||||||
|
|
||||||
UseN n = n ;
|
UseN n = n ;
|
||||||
UseN2 n = n ;
|
UseN2 n = n ;
|
||||||
|
|||||||
@@ -41,4 +41,55 @@ lin pot3 n = {
|
|||||||
s = \\c => n.s ! NCard ++ mkCard c "thousand" ; n = Pl} ;
|
s = \\c => n.s ! NCard ++ mkCard c "thousand" ; n = Pl} ;
|
||||||
lin pot3plus n m = {
|
lin pot3plus n m = {
|
||||||
s = \\c => n.s ! NCard ++ "thousand" ++ m.s ! c ; n = Pl} ;
|
s = \\c => n.s ! NCard ++ "thousand" ++ m.s ! c ; n = Pl} ;
|
||||||
|
|
||||||
|
-- numerals as sequences of digits
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Dig = TDigit ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
IDig d = d ** {tail = T1} ;
|
||||||
|
|
||||||
|
IIDig d i = {
|
||||||
|
s = \\o => d.s ! o ++ commaIf i.tail ++ i.s ! o ;
|
||||||
|
n = Pl ;
|
||||||
|
tail = inc i.tail
|
||||||
|
} ;
|
||||||
|
|
||||||
|
D_0 = mkDig "0" ;
|
||||||
|
D_1 = mk3Dig "1" "1st" Sg ;
|
||||||
|
D_2 = mk2Dig "2" "2nd" ;
|
||||||
|
D_3 = mk2Dig "3" "3rd" ;
|
||||||
|
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
|
||||||
|
commaIf : DTail -> Str = \t -> case t of {
|
||||||
|
T3 => "," ;
|
||||||
|
_ => []
|
||||||
|
} ;
|
||||||
|
|
||||||
|
inc : DTail -> DTail = \t -> case t of {
|
||||||
|
T1 => T2 ;
|
||||||
|
T2 => T3 ;
|
||||||
|
T3 => T1
|
||||||
|
} ;
|
||||||
|
|
||||||
|
mk2Dig : Str -> Str -> TDigit = \c,o -> mk3Dig c o Pl ;
|
||||||
|
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "th") ;
|
||||||
|
|
||||||
|
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||||
|
s = table {NCard => c ; NOrd => o} ;
|
||||||
|
n = n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
TDigit = {
|
||||||
|
n : Number ;
|
||||||
|
s : CardOrd => Str
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ concrete StructuralEng of Structural = CatEng **
|
|||||||
everything_NP = regNP "everything" Sg ;
|
everything_NP = regNP "everything" Sg ;
|
||||||
everywhere_Adv = ss "everywhere" ;
|
everywhere_Adv = ss "everywhere" ;
|
||||||
few_Det = mkDeterminer Pl "few" ;
|
few_Det = mkDeterminer Pl "few" ;
|
||||||
first_Ord = ss "first" ;
|
--- first_Ord = ss "first" ; DEPRECATED
|
||||||
for_Prep = ss "for" ;
|
for_Prep = ss "for" ;
|
||||||
from_Prep = ss "from" ;
|
from_Prep = ss "from" ;
|
||||||
he_Pron = mkNP "he" "him" "his" Sg P3 ;
|
he_Pron = mkNP "he" "him" "his" Sg P3 ;
|
||||||
@@ -71,7 +71,7 @@ concrete StructuralEng of Structural = CatEng **
|
|||||||
} ;
|
} ;
|
||||||
no_Phr = ss "no" ;
|
no_Phr = ss "no" ;
|
||||||
on_Prep = ss "on" ;
|
on_Prep = ss "on" ;
|
||||||
one_Quant = mkDeterminer Sg "one" ;
|
---- one_Quant = mkDeterminer Sg "one" ; -- DEPRECATED
|
||||||
only_Predet = ss "only" ;
|
only_Predet = ss "only" ;
|
||||||
or_Conj = ss "or" ** {n = Sg} ;
|
or_Conj = ss "or" ** {n = Sg} ;
|
||||||
otherwise_PConj = ss "otherwise" ;
|
otherwise_PConj = ss "otherwise" ;
|
||||||
|
|||||||
@@ -56,15 +56,16 @@ concrete CatFin of Cat = CommonX ** open ResFin, Prelude in {
|
|||||||
isPoss : Bool ; -- True (a possessive suffix is present)
|
isPoss : Bool ; -- True (a possessive suffix is present)
|
||||||
isDef : Bool -- True (verb agrees in Pl, Nom is not Part)
|
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} ;
|
Ord = {s : Number => Case => Str} ;
|
||||||
Predet = {s : Number => NPForm => Str} ;
|
Predet = {s : Number => NPForm => Str} ;
|
||||||
Quant = {s1 : Number => Case => Str ; s2 : Str ; isPoss, isDef : Bool} ;
|
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
|
||||||
|
|
||||||
Numeral = {s : CardOrd => Str ; n : Number} ;
|
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||||
|
Digits = {s : CardOrd => Str ; n : Number} ;
|
||||||
|
|
||||||
-- Structural
|
-- Structural
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetSg quant ord = {
|
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 ;
|
s2 = quant.s2 ;
|
||||||
n = Sg ;
|
n = Sg ;
|
||||||
isNum = False ;
|
isNum = False ;
|
||||||
@@ -70,14 +70,15 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetPl quant num ord = {
|
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 ;
|
s2 = quant.s2 ;
|
||||||
n = Pl ;
|
n = num.n ;
|
||||||
isNum = num.isNum ;
|
isNum = num.isNum ;
|
||||||
isPoss = quant.isPoss ;
|
isPoss = quant.isPoss ;
|
||||||
isDef = quant.isDef
|
isDef = quant.isDef
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
{- --- DEPREC
|
||||||
SgQuant quant = {
|
SgQuant quant = {
|
||||||
s1 = quant.s1 ! Sg ;
|
s1 = quant.s1 ! Sg ;
|
||||||
s2 = quant.s2 ;
|
s2 = quant.s2 ;
|
||||||
@@ -92,7 +93,7 @@ concrete NounFin of Noun = CatFin ** open ResFin, Prelude in {
|
|||||||
isPoss = quant.isPoss ;
|
isPoss = quant.isPoss ;
|
||||||
isDef = quant.isDef
|
isDef = quant.isDef
|
||||||
} ;
|
} ;
|
||||||
|
-}
|
||||||
PossPron p = {
|
PossPron p = {
|
||||||
s1 = \\_,_ => p.s ! NPCase Gen ;
|
s1 = \\_,_ => p.s ! NPCase Gen ;
|
||||||
s2 = BIND ++ possSuffix p.a ;
|
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
|
isDef = True --- "minun kolme autoani ovat" ; thus "...on" is missing
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
NoNum = {s = \\_,_ => [] ; isNum = False} ;
|
NoNum = {s = \\_,_ => [] ; isNum = False ; n = Pl} ;
|
||||||
NoOrd = {s = \\_,_ => []} ;
|
NoOrd = {s = \\_,_ => []} ;
|
||||||
|
|
||||||
NumInt n = {s = \\_,_ => n.s ; isNum = True} ;
|
NumInt n = {s = \\_,_ => n.s ; isNum = True ; n = Pl} ; --DEPREC
|
||||||
OrdInt n = {s = \\_,_ => n.s ++ "."} ;
|
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)} ;
|
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)} ;
|
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 = {
|
MassDet = {
|
||||||
s1 = \\_ => [] ; --- Nom is Part ?
|
s1 = \\_,_ => [] ; --- Nom is Part ?
|
||||||
s2 = [] ;
|
s2 = [] ;
|
||||||
isNum,isPoss,isDef = False
|
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 ;
|
{lock_N = <>}) Sg ;
|
||||||
everywhere_Adv = ss "kaikkialla" ;
|
everywhere_Adv = ss "kaikkialla" ;
|
||||||
few_Det = mkDet Sg (regN "harva") ;
|
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 ;
|
for_Prep = casePrep allative ;
|
||||||
from_Prep = casePrep elative ;
|
from_Prep = casePrep elative ;
|
||||||
he_Pron = mkPronoun "hän" "hänen" "häntä" "hänenä" "häneen" Sg P3 ;
|
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 ;
|
must_VV = subjcaseV (regV "täytyä") genitive ;
|
||||||
no_Phr = ss "ei" ;
|
no_Phr = ss "ei" ;
|
||||||
on_Prep = casePrep adessive ;
|
on_Prep = casePrep adessive ;
|
||||||
one_Quant = mkDet Sg
|
--- one_Quant = mkDet Sg DEPREC
|
||||||
(nhn (mkSubst "ä" "yksi" "yhde" "yhte" "yhtä" "yhteen" "yksi" "yksi"
|
|
||||||
"yksien" "yksiä" "yksiin")) ;
|
|
||||||
only_Predet = {s = \\_,_ => "vain"} ;
|
only_Predet = {s = \\_,_ => "vain"} ;
|
||||||
or_Conj = ss "tai" ** {n = Sg} ;
|
or_Conj = ss "tai" ** {n = Sg} ;
|
||||||
otherwise_PConj = ss "muuten" ;
|
otherwise_PConj = ss "muuten" ;
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ concrete CatGer of Cat =
|
|||||||
NP = {s : Case => Str ; a : Agr} ;
|
NP = {s : Case => Str ; a : Agr} ;
|
||||||
Pron = {s : NPForm => Str ; a : Agr} ;
|
Pron = {s : NPForm => Str ; a : Agr} ;
|
||||||
Det = {s : Gender => Case => Str ; n : Number ; a : Adjf} ;
|
Det = {s : Gender => Case => Str ; n : Number ; a : Adjf} ;
|
||||||
QuantSg, QuantPl = {s : Gender => Case => Str ; a : Adjf} ;
|
--- QuantSg, QuantPl = {s : Gender => Case => Str ; a : Adjf} ; DEPREC
|
||||||
Quant = {s : Number => Gender => Case => Str ; a : Adjf} ;
|
Quant = {s : Number => Gender => Case => Str ; a : Adjf} ;
|
||||||
Predet = {s : Number => Gender => Case => Str} ;
|
Predet = {s : Number => Gender => Case => Str} ;
|
||||||
Num = {s : Str; n : Number } ;
|
Num = {s : Str; n : Number } ;
|
||||||
@@ -56,6 +56,7 @@ concrete CatGer of Cat =
|
|||||||
-- Numeral
|
-- Numeral
|
||||||
|
|
||||||
Numeral = {s : CardOrd => Str ; n : Number } ;
|
Numeral = {s : CardOrd => Str ; n : Number } ;
|
||||||
|
Digits = {s : CardOrd => Str ; n : Number } ;
|
||||||
|
|
||||||
-- Structural
|
-- Structural
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
n = Sg ;
|
n = Sg ;
|
||||||
a = quant.a
|
a = quant.a
|
||||||
in {
|
in {
|
||||||
s = \\g,c => quant.s ! g ! c ++
|
s = \\g,c => quant.s ! n ! g ! c ++
|
||||||
ord.s ! agrAdj g (adjfCase a c) n c ;
|
ord.s ! agrAdj g (adjfCase a c) n c ;
|
||||||
n = n ;
|
n = n ;
|
||||||
a = a
|
a = a
|
||||||
@@ -46,12 +46,13 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
n = num.n ;
|
n = num.n ;
|
||||||
a = quant.a
|
a = quant.a
|
||||||
in {
|
in {
|
||||||
s = \\g,c => quant.s ! g ! c ++
|
s = \\g,c => quant.s ! n ! g ! c ++
|
||||||
num.s ++ ord.s ! agrAdj g (adjfCase a c) n c ;
|
num.s ++ ord.s ! agrAdj g (adjfCase a c) n c ;
|
||||||
n = n ;
|
n = n ;
|
||||||
a = a
|
a = a
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
{- --- DEPREC
|
||||||
SgQuant q = {
|
SgQuant q = {
|
||||||
s = q.s ! Sg ;
|
s = q.s ! Sg ;
|
||||||
a = q.a
|
a = q.a
|
||||||
@@ -60,6 +61,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
s = q.s ! Pl ;
|
s = q.s ! Pl ;
|
||||||
a = q.a
|
a = q.a
|
||||||
} ;
|
} ;
|
||||||
|
-}
|
||||||
|
|
||||||
PossPron p = {
|
PossPron p = {
|
||||||
s = \\n,g,c => p.s ! NPPoss (gennum g n) c ;
|
s = \\n,g,c => p.s ! NPPoss (gennum g n) c ;
|
||||||
@@ -76,6 +78,9 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
OrdInt n = {s = \\_ => n.s ++ "."} ;
|
OrdInt n = {s = \\_ => n.s ++ "."} ;
|
||||||
|
|
||||||
|
NumDigits numeral = {s = numeral.s ! NCard; n = numeral.n } ;
|
||||||
|
OrdDigits numeral = {s = \\af => numeral.s ! NOrd af} ;
|
||||||
|
|
||||||
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n } ;
|
NumNumeral numeral = {s = numeral.s ! NCard; n = numeral.n } ;
|
||||||
OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ;
|
OrdNumeral numeral = {s = \\af => numeral.s ! NOrd af} ;
|
||||||
|
|
||||||
@@ -97,8 +102,7 @@ concrete NounGer of Noun = CatGer ** open ResGer, Prelude in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
MassDet = {
|
MassDet = {
|
||||||
s = \\g,c => [] ;
|
s = \\_,g,c => [] ;
|
||||||
n = Sg ;
|
|
||||||
a = Strong
|
a = Strong
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|||||||
@@ -45,4 +45,42 @@ lin
|
|||||||
pot3plus n m =
|
pot3plus n m =
|
||||||
{s = \\g => n.s ! invNum ++ "tausend" ++ m.s ! g ; n = Pl} ;
|
{s = \\g => n.s ! invNum ++ "tausend" ++ m.s ! g ; n = Pl} ;
|
||||||
|
|
||||||
|
|
||||||
|
lincat
|
||||||
|
Dig = TDigit ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
IDig d = d ;
|
||||||
|
|
||||||
|
IIDig d i = {
|
||||||
|
s = \\o => d.s ! o ++ i.s ! o ;
|
||||||
|
n = Pl
|
||||||
|
} ;
|
||||||
|
|
||||||
|
---- TODO: case endings of ordinals
|
||||||
|
D_0 = mkDig "0" ;
|
||||||
|
D_1 = mk3Dig "1" "1e" Sg ;
|
||||||
|
D_2 = mk2Dig "2" "2e" ;
|
||||||
|
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 Pl ;
|
||||||
|
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ;
|
||||||
|
|
||||||
|
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||||
|
s = table {NCard => c ; NOrd _ => o} ;
|
||||||
|
n = n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
TDigit = {
|
||||||
|
n : Number ;
|
||||||
|
s : CardOrd => Str
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -34,7 +34,7 @@ concrete StructuralGer of Structural = CatGer **
|
|||||||
everything_NP = nameNounPhrase {s = caselist "alles" "alles" "allem" "alles"} ;
|
everything_NP = nameNounPhrase {s = caselist "alles" "alles" "allem" "alles"} ;
|
||||||
everywhere_Adv = ss "überall" ;
|
everywhere_Adv = ss "überall" ;
|
||||||
few_Det = detLikeAdj Pl "wenig" ;
|
few_Det = detLikeAdj Pl "wenig" ;
|
||||||
first_Ord = {s = (regA "erst").s ! Posit} ;
|
---- first_Ord = {s = (regA "erst").s ! Posit} ;
|
||||||
for_Prep = mkPrep "für" Acc ;
|
for_Prep = mkPrep "für" Acc ;
|
||||||
from_Prep = mkPrep "aus" Dat ;
|
from_Prep = mkPrep "aus" Dat ;
|
||||||
he_Pron = mkPronPers "er" "ihn" "ihm" "seiner" "sein" Masc Sg P3 ;
|
he_Pron = mkPronPers "er" "ihn" "ihm" "seiner" "sein" Masc Sg P3 ;
|
||||||
@@ -59,11 +59,7 @@ concrete StructuralGer of Structural = CatGer **
|
|||||||
"mußte" "mußtest" "mußten" "mußtet"
|
"mußte" "mußtest" "mußten" "mußtet"
|
||||||
"müßte" "gemußt" []
|
"müßte" "gemußt" []
|
||||||
VHaben) ;
|
VHaben) ;
|
||||||
one_Quant = {
|
--- one_Quant = DEPREC
|
||||||
s = \\g,c => "ein" + pronEnding ! GSg g ! c ;
|
|
||||||
n = Sg ;
|
|
||||||
a = Strong
|
|
||||||
} ;
|
|
||||||
only_Predet = {s = \\_,_,_ => "nur"} ;
|
only_Predet = {s = \\_,_,_ => "nur"} ;
|
||||||
no_Phr = ss "nein" ;
|
no_Phr = ss "nein" ;
|
||||||
on_Prep = mkPrep "auf" Dat ;
|
on_Prep = mkPrep "auf" Dat ;
|
||||||
|
|||||||
@@ -43,5 +43,43 @@ lin
|
|||||||
pot3plus n m =
|
pot3plus n m =
|
||||||
{s = \\g => n.s ! invNum ++ "tusen" ++ "og" ++ m.s ! g ; n = Pl} ;
|
{s = \\g => n.s ! invNum ++ "tusen" ++ "og" ++ m.s ! g ; n = Pl} ;
|
||||||
|
|
||||||
|
-- Numerals from sequences of digits.
|
||||||
|
|
||||||
|
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" "1e" Sg ;
|
||||||
|
D_2 = mk2Dig "2" "2e" ;
|
||||||
|
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 Pl ;
|
||||||
|
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ;
|
||||||
|
|
||||||
|
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||||
|
s = table {NCard _ => c ; NOrd _ => o} ;
|
||||||
|
n = n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
TDigit = {
|
||||||
|
n : Number ;
|
||||||
|
s : CardOrd => Str
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ concrete StructuralNor of Structural = CatNor **
|
|||||||
everything_NP = regNP "alt" "alts" SgNeutr ;
|
everything_NP = regNP "alt" "alts" SgNeutr ;
|
||||||
everywhere_Adv = ss "overalt" ;
|
everywhere_Adv = ss "overalt" ;
|
||||||
few_Det = {s = \\_,_ => "få" ; n = Pl ; det = DDef Indef} ;
|
few_Det = {s = \\_,_ => "få" ; n = Pl ; det = DDef Indef} ;
|
||||||
first_Ord = {s = "første" ; isDet = True} ;
|
--- first_Ord = {s = "første" ; isDet = True} ; DEPREC
|
||||||
for_Prep = ss "for" ;
|
for_Prep = ss "for" ;
|
||||||
from_Prep = ss "fra" ;
|
from_Prep = ss "fra" ;
|
||||||
he_Pron = MorphoNor.mkNP "han" "ham" "hans" "hans" "hans" SgUtr P3 ;
|
he_Pron = MorphoNor.mkNP "han" "ham" "hans" "hans" "hans" SgUtr P3 ;
|
||||||
@@ -53,7 +53,7 @@ concrete StructuralNor of Structural = CatNor **
|
|||||||
mkV "måtte" "må" "må" "måtte" "måttet" "mått" ** {c2 = [] ; lock_VV = <>} ;
|
mkV "måtte" "må" "må" "måtte" "måttet" "mått" ** {c2 = [] ; lock_VV = <>} ;
|
||||||
no_Phr = ss ["Nei"] ;
|
no_Phr = ss ["Nei"] ;
|
||||||
on_Prep = ss "på" ;
|
on_Prep = ss "på" ;
|
||||||
one_Quant = {s = \\_ => genderForms ["en"] ["et"] ; n = Sg ; det = DIndef} ; --- ei
|
--- one_Quant = {s = \\_ => genderForms ["en"] ["et"] ; n = Sg ; det = DIndef} ; DEPREC
|
||||||
only_Predet = {s = \\_ => "kun"} ;
|
only_Predet = {s = \\_ => "kun"} ;
|
||||||
or_Conj = ss "eller" ** {n = Sg} ;
|
or_Conj = ss "eller" ** {n = Sg} ;
|
||||||
otherwise_PConj = ss "annarledes" ;
|
otherwise_PConj = ss "annarledes" ;
|
||||||
|
|||||||
@@ -60,16 +60,17 @@ incomplete concrete CatScand of Cat =
|
|||||||
CN = {s : Number => DetSpecies => Case => Str ; g : Gender ; isMod : Bool} ;
|
CN = {s : Number => DetSpecies => Case => Str ; g : Gender ; isMod : Bool} ;
|
||||||
NP,Pron = {s : NPForm => Str ; a : Agr} ;
|
NP,Pron = {s : NPForm => Str ; a : Agr} ;
|
||||||
Det = {s : Bool => Gender => Str ; n : Number ; det : DetSpecies} ;
|
Det = {s : Bool => Gender => Str ; n : Number ; det : DetSpecies} ;
|
||||||
QuantSg = {s : Bool => Gender => Str ; det : DetSpecies} ;
|
--- QuantSg = {s : Bool => Gender => Str ; det : DetSpecies} ;
|
||||||
QuantPl = {s : Bool => Gender => Str ; det : DetSpecies} ;
|
--- QuantPl = {s : Bool => Gender => Str ; n : Number ; det : DetSpecies} ;
|
||||||
Quant = {s : Number => Bool => Gender => Str ; det : DetSpecies} ;
|
Quant = {s : Number => Bool => Gender => Str ; det : DetSpecies} ;
|
||||||
Predet = {s : GenNum => Str} ;
|
Predet = {s : GenNum => Str} ;
|
||||||
Num = {s : Gender => Str ; isDet : Bool} ;
|
Num = {s : Gender => Str ; isDet : Bool ; n : Number} ;
|
||||||
Ord = {s : Str ; isDet : Bool} ;
|
Ord = {s : Str ; isDet : Bool} ;
|
||||||
|
|
||||||
-- Numeral
|
-- Numeral
|
||||||
|
|
||||||
Numeral = {s : CardOrd => Str ; n : Number} ;
|
Numeral = {s : CardOrd => Str ; n : Number} ;
|
||||||
|
Digits = {s : CardOrd => Str ; n : Number} ;
|
||||||
|
|
||||||
-- Structural
|
-- Structural
|
||||||
|
|
||||||
|
|||||||
@@ -46,17 +46,18 @@ incomplete concrete NounScand of Noun =
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
DetSg quant ord = {
|
DetSg quant ord = {
|
||||||
s = \\b,g => quant.s ! (orB b ord.isDet) ! g ++ ord.s ;
|
s = \\b,g => quant.s ! Sg ! (orB b ord.isDet) ! g ++ ord.s ;
|
||||||
n = Sg ;
|
n = Sg ;
|
||||||
det = quant.det
|
det = quant.det
|
||||||
} ;
|
} ;
|
||||||
DetPl quant num ord = {
|
DetPl quant num ord = {
|
||||||
s = \\b,g => quant.s ! (orB b (orB num.isDet ord.isDet)) ! g ++
|
s = \\b,g => quant.s ! num.n ! (orB b (orB num.isDet ord.isDet)) ! g ++
|
||||||
num.s ! g ++ ord.s ;
|
num.s ! g ++ ord.s ;
|
||||||
n = Pl ;
|
n = num.n ;
|
||||||
det = quant.det
|
det = quant.det
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
{- --- DEPREC
|
||||||
SgQuant quant = {
|
SgQuant quant = {
|
||||||
s = quant.s ! Sg ;
|
s = quant.s ! Sg ;
|
||||||
n = Sg ;
|
n = Sg ;
|
||||||
@@ -67,22 +68,26 @@ incomplete concrete NounScand of Noun =
|
|||||||
n = Pl ;
|
n = Pl ;
|
||||||
det = quant.det
|
det = quant.det
|
||||||
} ;
|
} ;
|
||||||
|
-}
|
||||||
|
|
||||||
PossPron p = {
|
PossPron p = {
|
||||||
s = \\n,_,g => p.s ! NPPoss (gennum g n) ;
|
s = \\n,_,g => p.s ! NPPoss (gennum g n) ;
|
||||||
det = DDef Indef
|
det = DDef Indef
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
NoNum = {s = \\_ => [] ; isDet = False} ;
|
NoNum = {s = \\_ => [] ; isDet = False ; n = Pl} ;
|
||||||
NoOrd = {s = [] ; isDet = False} ;
|
NoOrd = {s = [] ; isDet = False} ;
|
||||||
|
|
||||||
NumInt n = {s = \\_ => n.s ; isDet = True} ;
|
NumInt n = {s = \\_ => n.s ; isDet = True ; n = Pl} ; --- DEPRECATED
|
||||||
OrdInt n = {s = n.s ++ ":e" ; isDet = True} ; ---
|
OrdInt n = {s = n.s ++ ":e" ; isDet = True} ; --- DEPRECATED
|
||||||
|
|
||||||
NumNumeral numeral = {s = \\g => numeral.s ! NCard g ; isDet = True} ;
|
NumDigits nu = {s = \\g => nu.s ! NCard g ; isDet = True ; n = nu.n} ;
|
||||||
OrdNumeral numeral = {s = numeral.s ! NOrd SupWeak ; isDet = True} ;
|
OrdDigits nu = {s = nu.s ! NOrd SupWeak ; isDet = True} ;
|
||||||
|
|
||||||
AdNum adn num = {s = \\g => adn.s ++ num.s ! g ; isDet = True} ;
|
NumNumeral nu = {s = \\g => nu.s ! NCard g ; isDet = True ; n = nu.n} ;
|
||||||
|
OrdNumeral nu = {s = nu.s ! NOrd SupWeak ; isDet = True} ;
|
||||||
|
|
||||||
|
AdNum adn num = {s = \\g => adn.s ++ num.s ! g ; isDet = True ; n = num.n} ;
|
||||||
|
|
||||||
OrdSuperl a = {
|
OrdSuperl a = {
|
||||||
s = case a.isComp of {
|
s = case a.isComp of {
|
||||||
@@ -105,7 +110,7 @@ incomplete concrete NounScand of Noun =
|
|||||||
det = DIndef
|
det = DIndef
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
MassDet = {s = \\_,_ => [] ; n = Sg ; det = DIndef} ;
|
MassDet = {s = \\_,_,_ => [] ; n = Sg ; det = DIndef} ;
|
||||||
|
|
||||||
UseN, UseN2, UseN3 = \noun -> {
|
UseN, UseN2, UseN3 = \noun -> {
|
||||||
s = \\n,d,c => noun.s ! n ! specDet d ! c ;
|
s = \\n,d,c => noun.s ! n ! specDet d ! c ;
|
||||||
|
|||||||
@@ -43,5 +43,41 @@ lin
|
|||||||
pot3plus n m =
|
pot3plus n m =
|
||||||
{s = \\g => n.s ! invNum ++ "tusen" ++ m.s ! g ; n = Pl} ;
|
{s = \\g => n.s ! invNum ++ "tusen" ++ m.s ! g ; n = Pl} ;
|
||||||
|
|
||||||
|
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" "1a" Sg ;
|
||||||
|
D_2 = mk2Dig "2" "2a" ;
|
||||||
|
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 Pl ;
|
||||||
|
mkDig : Str -> TDigit = \c -> mk2Dig c (c + "e") ;
|
||||||
|
|
||||||
|
mk3Dig : Str -> Str -> Number -> TDigit = \c,o,n -> {
|
||||||
|
s = table {NCard _ => c ; NOrd _ => o} ;
|
||||||
|
n = n
|
||||||
|
} ;
|
||||||
|
|
||||||
|
TDigit = {
|
||||||
|
n : Number ;
|
||||||
|
s : CardOrd => Str
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ concrete StructuralSwe of Structural = CatSwe **
|
|||||||
everything_NP = regNP "allting" "alltings" SgNeutr ;
|
everything_NP = regNP "allting" "alltings" SgNeutr ;
|
||||||
everywhere_Adv = ss "överallt" ;
|
everywhere_Adv = ss "överallt" ;
|
||||||
few_Det = {s = \\_,_ => "få" ; n = Pl ; det = DDef Indef} ;
|
few_Det = {s = \\_,_ => "få" ; n = Pl ; det = DDef Indef} ;
|
||||||
first_Ord = {s = "första" ; isDet = True} ;
|
--- first_Ord = {s = "första" ; isDet = True} ;
|
||||||
for_Prep = ss "för" ;
|
for_Prep = ss "för" ;
|
||||||
from_Prep = ss "från" ;
|
from_Prep = ss "från" ;
|
||||||
he_Pron = MorphoSwe.mkNP "han" "honom" "hans" "hans" "hans" SgUtr P3 ;
|
he_Pron = MorphoSwe.mkNP "han" "honom" "hans" "hans" "hans" SgUtr P3 ;
|
||||||
@@ -52,7 +52,7 @@ concrete StructuralSwe of Structural = CatSwe **
|
|||||||
mkV "få" "måste" "få" "fick" "måst" "måst" ** {c2 = [] ; lock_VV = <>} ;
|
mkV "få" "måste" "få" "fick" "måst" "måst" ** {c2 = [] ; lock_VV = <>} ;
|
||||||
no_Phr = ss ["nej"] ;
|
no_Phr = ss ["nej"] ;
|
||||||
on_Prep = ss "på" ;
|
on_Prep = ss "på" ;
|
||||||
one_Quant = {s = \\_ => genderForms ["en"] ["ett"] ; n = Sg ; det = DIndef} ;
|
--- one_Quant = {s = \\_ => genderForms ["en"] ["ett"] ; n = Sg ; det = DIndef} ;
|
||||||
only_Predet = {s = \\_ => "bara"} ;
|
only_Predet = {s = \\_ => "bara"} ;
|
||||||
or_Conj = ss "eller" ** {n = Sg} ;
|
or_Conj = ss "eller" ** {n = Sg} ;
|
||||||
otherwise_PConj = ss "annars" ;
|
otherwise_PConj = ss "annars" ;
|
||||||
|
|||||||
Reference in New Issue
Block a user