mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-29 12:48:54 -06:00
swadesh fixes; bug fix in i -old
This commit is contained in:
@@ -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 ->
|
||||
|
||||
Reference in New Issue
Block a user