1
0
forked from GitHub/gf-rgl

(Ara) Add various functions to make SymbolicAra work.

This commit is contained in:
Inari Listenmaa
2018-09-18 11:30:58 +02:00
parent c660dd6aa5
commit db0bbfd1fb
5 changed files with 41 additions and 30 deletions

View File

@@ -41,14 +41,14 @@ concrete CatAra of Cat = CommonX - [Utt] ** open ResAra, Prelude, ParamX in {
-- --
-- Adjective -- Adjective
AP = {s : Species => Gender => NTable } ; AP = ResAra.AP ;
-- Noun -- Noun
CN = ResAra.Noun ** {adj : NTable}; CN = ResAra.Noun ** {adj : NTable};
NP, Pron = ResAra.NP; --{s : Case => Str ; a : Agr } ; NP, Pron = ResAra.NP; --{s : Case => Str ; a : Agr } ;
Num, Ord, Card = {s : Gender => State => Case => Str ; Num, Ord, Card = ResAra.NumOrdCard ;
n : Size };
Predet = ResAra.Predet ; Predet = ResAra.Predet ;
-- DEPRECATED -- DEPRECATED

View File

@@ -189,5 +189,6 @@ lin
-- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ; -- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.s} ;
-- --
-- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ; -- SentCN cn sc = {s = \\n,c => cn.s ! n ! c ++ sc.s} ;
-- ApposCN cn np = ApposCN cn np = cn ** {
s = \\n,d,c => cn.s ! n ! d ! c ++ np.s ! c } ;
} }

View File

@@ -18,9 +18,9 @@ concrete PhraseAra of Phrase = CatAra ** open
UttIP ip = {s = \\_ => ip.s} ; ---- AR UttIP ip = {s = \\_ => ip.s} ; ---- AR
-- AP = { s : Species => Gender => Number => State => Case => Str } ; -- AP = { s : Species => Gender => Number => State => Case => Str } ;
UttAP ap = {s = \\g => ap.s ! NoHum ! g ! ResAra.Sg ! Def ! Nom } ; ---- OK? IL UttAP ap = {s = ResAra.uttAP ap} ; --IL
-- Card = {s : Gender => State => Case => Str } ; -- Card = {s : Gender => State => Case => Str } ;
UttCard c = {s = \\g => c.s ! g ! Def ! Nom } ; ---- OK? IL UttCard c = {s = ResAra.uttNum c} ; --IL
-- UttIAdv iadv = iadv ; -- UttIAdv iadv = iadv ;
UttNP np = {s = \\_ => np.s ! Nom} ; UttNP np = {s = \\_ => np.s ! Nom} ;

View File

@@ -110,6 +110,14 @@ resource ResAra = PatternsAra ** open Prelude, Predef in {
Adj : Type = {s : AForm => Str} ; Adj : Type = {s : AForm => Str} ;
Verb : Type = {s : VForm => Str} ; Verb : Type = {s : VForm => Str} ;
AP : Type = {s : Species => Gender => NTable } ;
uttAP : AP -> (Gender => Str) ;
uttAP ap = \\g => ap.s ! NoHum ! g ! Sg ! Def ! Nom ; ----IL
NumOrdCard : Type = {s : Gender => State => Case => Str ; n : Size };
uttNum : NumOrdCard -> (Gender => Str) ;
uttNum n = \\g => n.s ! g ! Def ! Nom ; ----IL
param param
VForm = VForm =
VPerf Voice PerGenNum VPerf Voice PerGenNum
@@ -975,7 +983,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
mkIP : Str -> Number -> {s : Str ; n : Number} = mkIP : Str -> Number -> {s : Str ; n : Number} =
\s,n -> {s = s ; n = n} ; \s,n -> {s = s ; n = n} ;
mkOrd : (_,_ : Str) -> {s : Gender => State => Case => Str ; n : Size } = mkOrd : (_,_ : Str) -> NumOrdCard =
\aysar,yusra -> \aysar,yusra ->
{ s = \\g,s,c => { s = \\g,s,c =>
case g of { case g of {

View File

@@ -2,34 +2,32 @@
concrete SymbolAra of Symbol = CatAra ** open Prelude, ResAra in { concrete SymbolAra of Symbol = CatAra ** open Prelude, ResAra in {
{-
lin
SymbPN i = {s = \\c => i.s ; g = Neutr} ; --- c
IntPN i = {s = \\c => i.s ; g = Neutr} ; --- c
FloatPN i = {s = \\c => i.s ; g = Neutr} ; --- c
NumPN i = {s = i.s ! Neutr ; g = Neutr} ; --- c
CNIntNP cn i = { lin
s = \\c => cn.s ! Weak ! Sg ! Nom ++ i.s ; SymbPN i = {s = \\c => i.s ; g = Masc ; h = NoHum } ; --IL
a = agrP3 Sg ; IntPN i = {s = \\c => i.s ; g = Masc ; h = NoHum } ; --IL
isPron = False FloatPN i = {s = \\c => i.s ; g = Masc ; h = NoHum } ; --IL
} ; NumPN i = {s = \\c => uttNum i ! Masc ; g = Masc ; h = NoHum } ; --IL
CNSymbNP det cn xs = let g = cn.g in { -- CNIntNP cn i = {
s = \\c => det.s ! g ! c ++ cn.s ! adjfCase det.a c ! det.n ! c ++ xs.s ; -- s = \\c => cn.s ! Sg ! Def ! c ++ uttNum i ! Masc ;
a = agrP3 det.n ; -- a = dummyAgrP3 Sg ;
isPron = False -- } ;
--IL TODO: check out some opers regarding state in ResAra. These are just dummy values.
CNSymbNP det cn xs =
let g = cn.g ; n = sizeToNumber det.n in {
s = \\c => det.s ! NoHum ! g ! c ++ cn.s ! Sg ! Def ! c ++ cn.adj ! n ! Def ! c ++ xs.s; ----IL word order?? Seems to be nontrivial according to ResAra comments.
a = dummyAgrP3 n ;
} ; } ;
CNNumNP cn i = { CNNumNP cn i = {
s = \\c => artDef ! (GSg cn.g) ! c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ; s = \\c => cn.s ! Sg ! Def ! c ++ uttNum i ! Masc ;
a = agrP3 Sg ; a = dummyAgrP3 Sg ;
isPron = False
} ; } ;
SymbS sy = {s = \\_ => sy.s} ; SymbS sy = sy ;
SymbNum n = {s = \\_,_ => n.s ; n = Pl ; isNum = True} ;
SymbOrd n = {s = \\_ => n.s ++ "."} ;
SymbOrd n = {s = \\_,_,_ => n.s ; n = None } ;
SymbNum n = SymbOrd n ** { n = ThreeTen } ; ----IL
lincat lincat
@@ -39,9 +37,13 @@ lin
MkSymb s = s ; MkSymb s = s ;
BaseSymb = infixSS "und" ; BaseSymb = infixSS "und" ; ----
ConsSymb = infixSS "," ; ConsSymb = infixSS "," ;
-}
oper
dummyAgrP3 : Number -> Agr = \n ->
{ pgn = Per3 Masc n ; isPron = False } ;
} }