forked from GitHub/gf-core
swadesh fixes; bug fix in i -old
This commit is contained in:
@@ -226,6 +226,8 @@ oper mkTal : Str -> Str -> Str -> {s : DForm => Str} =
|
||||
\to, tolv, tyve ->
|
||||
{s = table {ental => to ; ton => tolv ; tiotal => tyve}} ;
|
||||
oper regTal : Str -> {s : DForm => Str} = \fem -> mkTal fem (fem + "ton") (fem + "tio") ;
|
||||
numPl : Str -> {s : Gender => Str ; n : Number} = \n ->
|
||||
{s = \\_ => n ; n = Pl} ;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
-- AR 12/10/2002 following www.geocities.com/tsca.geo/dansk/dknummer.html
|
||||
|
||||
concrete NumeralsDan of Numerals = open Prelude, MorphoDan in {
|
||||
concrete NumeralsDan of Numerals = open Prelude, TypesDan, MorphoDan in {
|
||||
|
||||
lincat Numeral = {s : Str} ;
|
||||
lincat Digit = {s : DForm => Str} ;
|
||||
lincat Sub10 = {s : DForm => Str} ;
|
||||
lincat Sub100 = {s : Str} ;
|
||||
lincat Sub1000 = {s : Str} ;
|
||||
lincat Sub1000000 = {s : Str} ;
|
||||
lincat
|
||||
Numeral = {s : Gender => Str ; n : Number} ;
|
||||
Digit = {s : DForm => Str} ;
|
||||
Sub10 = {s : DForm => Gender => Str ; n : Number} ;
|
||||
Sub100 = {s : Gender => Str ; n : Number} ;
|
||||
Sub1000 = {s : Gender => Str ; n : Number} ;
|
||||
Sub1000000 = {s : Gender => Str ; n : Number} ;
|
||||
|
||||
lin num x = x ;
|
||||
|
||||
@@ -20,18 +21,20 @@ lin n7 = mkTal "syv" "sytten" "halvfjerds" ;
|
||||
lin n8 = mkTal "otte" "atten" "firs" ;
|
||||
lin n9 = mkTal "ni" "nitten" "halvfems" ;
|
||||
|
||||
lin pot01 = {s = table {f => "en"}} ; ---
|
||||
lin pot0 d = {s = table {f => d.s ! f}} ;
|
||||
lin pot110 = ss "ti" ;
|
||||
lin pot111 = ss "elleve" ;
|
||||
lin pot1to19 d = ss (d.s ! ton) ;
|
||||
lin pot0as1 n = ss (n.s ! ental) ;
|
||||
lin pot1 d = ss (d.s ! tiotal) ;
|
||||
lin pot1plus d e = ss (e.s ! ental ++ "og" ++ d.s ! tiotal) ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = ss (d.s ! ental ++ "hundrede") ;
|
||||
lin pot2plus d e = ss (d.s ! ental ++ "hundrede" ++ "og" ++ e.s) ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = ss (n.s ++ "tusind") ;
|
||||
lin pot3plus n m = ss (n.s ++ "tusind" ++ "og" ++ m.s) ; ---
|
||||
pot01 = {s = table {f => table {Neutr => "et" ; _ => "en"}} ; n = Sg} ;
|
||||
pot0 d = {s = \\f,g => d.s ! f ; n = Pl} ;
|
||||
pot110 = numPl "ti" ;
|
||||
pot111 = numPl "elleve" ;
|
||||
pot1to19 d = numPl (d.s ! ton) ;
|
||||
pot0as1 n = {s = n.s ! ental ; n = n.n} ;
|
||||
pot1 d = numPl (d.s ! tiotal) ;
|
||||
pot1plus d e = {s = \\g => e.s ! ental ! g ++ "og" ++ d.s ! tiotal ; n = Pl} ;
|
||||
pot1as2 n = n ;
|
||||
pot2 d = numPl (d.s ! ental ! Neutr ++ "hundrede") ;
|
||||
pot2plus d e =
|
||||
{s = \\g => d.s ! ental ! Neutr ++ "hundrede" ++ "og" ++ e.s ! g ; n = Pl} ;
|
||||
pot2as3 n = n ;
|
||||
pot3 n = numPl (n.s ! Neutr ++ "tusind") ;
|
||||
pot3plus n m = {s = \\g => n.s ! Neutr ++ "tusind" ++ "og" ++ m.s ! g ; n = Pl} ;
|
||||
|
||||
}
|
||||
@@ -11,7 +11,10 @@ concrete StructuralDan of Structural =
|
||||
|
||||
lin
|
||||
|
||||
UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; ---
|
||||
UseNumeral i = {
|
||||
s = \\g => table {Nom => i.s ! g ; Gen => i.s ! g ++ "s"} ; ---
|
||||
n = i.n
|
||||
} ;
|
||||
|
||||
above_Prep = ss "ovenfor" ;
|
||||
after_Prep = ss "efter" ;
|
||||
|
||||
@@ -38,7 +38,7 @@ lincat
|
||||
N2 = Function ;
|
||||
-- = CommNounPhrase ** {s2 : Preposition} ;
|
||||
N3 = Function ** {s3 : Preposition} ;
|
||||
Num = {s : Case => Str} ;
|
||||
Num = {s : Case => Str ; n : Number} ;
|
||||
Prep = {s : Str} ;
|
||||
|
||||
A = Adjective ;
|
||||
|
||||
@@ -1,8 +1,11 @@
|
||||
concrete NumeralsEng of Numerals = open Prelude, MorphoEng in {
|
||||
|
||||
lincat Numeral = { s : Str } ;
|
||||
lincat Numeral = {s : Str ; n : Number} ;
|
||||
lincat Digit = {s : DForm => Str} ;
|
||||
lincat Sub10 = {s : DForm => Str} ;
|
||||
lincat Sub10 = {s : DForm => Str ; n : Number} ;
|
||||
Sub100 = {s : Str ; n : Number} ;
|
||||
Sub1000 = {s : Str ; n : Number} ;
|
||||
Sub1000000 = {s : Str ; n : Number} ;
|
||||
|
||||
lin num x = x ;
|
||||
lin n2 = mkNum "two" "twelve" "twenty" ;
|
||||
@@ -14,19 +17,19 @@ lin n7 = regNum "seven" ;
|
||||
lin n8 = mkNum "eight" "eighteen" "eighty" ;
|
||||
lin n9 = regNum "nine" ;
|
||||
|
||||
lin pot01 = {s = table {f => "one"}} ;
|
||||
lin pot0 d = {s = table {f => d.s ! f}} ;
|
||||
lin pot110 = ss "ten" ;
|
||||
lin pot111 = ss "eleven" ;
|
||||
lin pot1to19 d = {s = d.s ! teen} ;
|
||||
lin pot0as1 n = {s = n.s ! unit} ;
|
||||
lin pot1 d = {s = d.s ! ten} ;
|
||||
lin pot1plus d e = {s = d.s ! ten ++ "-" ++ e.s ! unit} ;
|
||||
lin pot01 = {s = table {f => "one"} ; n = Sg} ;
|
||||
lin pot0 d = {s = table {f => d.s ! f} ; n = Pl} ;
|
||||
lin pot110 = ss "ten" ** {n = Pl} ;
|
||||
lin pot111 = ss "eleven" ** {n = Pl} ;
|
||||
lin pot1to19 d = {s = d.s ! teen} ** {n = Pl} ;
|
||||
lin pot0as1 n = {s = n.s ! unit} ** {n = n.n} ;
|
||||
lin pot1 d = {s = d.s ! ten} ** {n = Pl} ;
|
||||
lin pot1plus d e = {s = d.s ! ten ++ "-" ++ e.s ! unit} ** {n = Pl} ;
|
||||
lin pot1as2 n = n ;
|
||||
lin pot2 d = {s = d.s ! unit ++ "hundred"} ;
|
||||
lin pot2plus d e = {s = d.s ! unit ++ "hundred" ++ "and" ++ e.s} ;
|
||||
lin pot2 d = {s = d.s ! unit ++ "hundred"} ** {n = Pl} ;
|
||||
lin pot2plus d e = {s = d.s ! unit ++ "hundred" ++ "and" ++ e.s} ** {n = Pl} ;
|
||||
lin pot2as3 n = n ;
|
||||
lin pot3 n = {s = n.s ++ "thousand"} ;
|
||||
lin pot3plus n m = {s = n.s ++ "thousand" ++ m.s} ;
|
||||
lin pot3 n = {s = n.s ++ "thousand"} ** {n = Pl} ;
|
||||
lin pot3plus n m = {s = n.s ++ "thousand" ++ m.s} ** {n = Pl} ;
|
||||
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ lin
|
||||
ModGenOne = npGenDet singular noNum ;
|
||||
ModGenNum = npGenDet plural ;
|
||||
|
||||
UseInt i = {s = table {Nom => i.s ; Gen => i.s ++ "s"}} ; ---
|
||||
UseInt i = {s = table {Nom => i.s ; Gen => i.s ++ "s"} ; n = Pl} ; ---
|
||||
NoNum = noNum ;
|
||||
|
||||
UseA = adj2adjPhrase ;
|
||||
|
||||
@@ -10,7 +10,7 @@ concrete StructuralEng of Structural =
|
||||
flags optimize=all ;
|
||||
|
||||
lin
|
||||
UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "'s"}} ; ---
|
||||
UseNumeral i = {s = table {Nom => i.s ; Gen => i.s ++ "'s"} ; n = i.n} ; ---
|
||||
|
||||
|
||||
above_Prep = ss "above" ;
|
||||
|
||||
@@ -75,13 +75,13 @@ oper
|
||||
-- The following construction has to be refined for genitive forms:
|
||||
-- "we two", "us two" are OK, but "our two" is not.
|
||||
|
||||
Numeral : Type = {s : Case => Str} ;
|
||||
Numeral : Type = {s : Case => Str ; n : Number} ;
|
||||
|
||||
pronWithNum : Pronoun -> Numeral -> Pronoun = \we,two ->
|
||||
{s = \\c => we.s ! c ++ two.s ! toCase c ; n = we.n ; p = we.p ; g
|
||||
= human} ;
|
||||
|
||||
noNum : Numeral = {s = \\_ => []} ;
|
||||
noNum : Numeral = {s = \\_ => [] ; n = Pl} ;
|
||||
|
||||
pronNounPhrase : Pronoun -> NounPhrase = \pro ->
|
||||
{s = pro.s ; a = toAgr pro.n pro.p pro.g} ;
|
||||
@@ -101,13 +101,13 @@ oper
|
||||
|
||||
numDetNounPhrase : DeterminerNum -> Numeral -> CommNounPhrase -> NounPhrase =
|
||||
\all, six, men ->
|
||||
{s = \\c => all.s ++ six.s ! Nom ++ men.s ! Pl ! toCase c ;
|
||||
a = toAgr Pl P3 men.g
|
||||
{s = \\c => all.s ++ six.s ! Nom ++ men.s ! six.n ! toCase c ;
|
||||
a = toAgr six.n P3 men.g
|
||||
} ;
|
||||
justNumDetNounPhrase : DeterminerNum -> Numeral -> NounPhrase =
|
||||
\all, six ->
|
||||
{s = \\c => all.s ++ six.s ! toCase c ;
|
||||
a = toAgr Pl P3 Neutr --- gender does not matter
|
||||
a = toAgr six.n P3 Neutr --- gender does not matter
|
||||
} ;
|
||||
|
||||
mkDeterminer : Number -> Str -> Determiner = \n,the ->
|
||||
@@ -142,9 +142,14 @@ oper
|
||||
\n,two,man ->
|
||||
{s = \\c => case n of {
|
||||
Sg => artIndef ++ two.s ! Nom ++ man.s ! n ! toCase c ;
|
||||
Pl => two.s ! Nom ++ man.s ! n ! toCase c
|
||||
Pl => two.s ! Nom ++ man.s ! two.n ! toCase c
|
||||
} ;
|
||||
a = toAgr n P3 man.g
|
||||
a = toAgr nb P3 man.g where {
|
||||
nb = case <n,two.n> of {
|
||||
<Pl,Pl> => Pl ;
|
||||
_ => Sg
|
||||
}
|
||||
}
|
||||
} ;
|
||||
|
||||
defNounPhrase : Number -> CommNounPhrase -> NounPhrase = \n ->
|
||||
|
||||
@@ -296,7 +296,7 @@ oper
|
||||
{s = np.s ; g = np.g ; p = np.p ; c = np.c ; n = n ; lock_NP = <>} ;
|
||||
|
||||
mkA a b c d = mkAdj a c b d ** {p = False ; lock_A = <>} ;
|
||||
regA a = mkAdjReg a False ** {p = False ; lock_A = <>} ;
|
||||
regA a = mkAdjReg a ** {p = False ; lock_A = <>} ;
|
||||
prefA a = {s = a.s ; p = True ; lock_A = <>} ;
|
||||
|
||||
mkA2 a p = a ** {c = p.p1 ; s2 = p.p2 ; lock_A2 = <>} ;
|
||||
|
||||
@@ -76,9 +76,6 @@ oper
|
||||
_ => (personPron Masc n p).s
|
||||
} ;
|
||||
|
||||
mkAdjReg : Str -> Bool -> Adjective = \adj,p ->
|
||||
mkAdjective (adjGrand adj) p ;
|
||||
|
||||
comparConj = elisQue ;
|
||||
|
||||
mkAdjDegrReg : Str -> Bool -> AdjDegr = \adj,p ->
|
||||
|
||||
@@ -594,6 +594,14 @@ oper
|
||||
|
||||
reflPron : Number => Person => NPFormA => Str ;
|
||||
|
||||
reflPronNounPhrase : Gender -> Number -> Person -> NounPhrase = \g,n,p ->
|
||||
{s = reflPron ! n ! p ;
|
||||
g = PGen g ; -- needed in participle agreement
|
||||
n = n ;
|
||||
p = p ;
|
||||
c = Clit1 ---- depends on person?
|
||||
} ;
|
||||
|
||||
---- There is no adverbial form for the past participle.
|
||||
|
||||
adjPastPart : Verb -> Adjective = \verb -> {
|
||||
|
||||
Reference in New Issue
Block a user