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
AP = {s : Species => Gender => NTable } ;
AP = ResAra.AP ;
-- Noun
CN = ResAra.Noun ** {adj : NTable};
NP, Pron = ResAra.NP; --{s : Case => Str ; a : Agr } ;
Num, Ord, Card = {s : Gender => State => Case => Str ;
n : Size };
Num, Ord, Card = ResAra.NumOrdCard ;
Predet = ResAra.Predet ;
-- DEPRECATED

View File

@@ -189,5 +189,6 @@ lin
-- AdvCN cn ad = {s = \\n,c => cn.s ! n ! c ++ ad.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
-- 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 } ;
UttCard c = {s = \\g => c.s ! g ! Def ! Nom } ; ---- OK? IL
UttCard c = {s = ResAra.uttNum c} ; --IL
-- UttIAdv iadv = iadv ;
UttNP np = {s = \\_ => np.s ! Nom} ;

View File

@@ -109,6 +109,14 @@ resource ResAra = PatternsAra ** open Prelude, Predef in {
-- Adj : Type = {s : Gender => NTable} ;
Adj : Type = {s : AForm => 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
VForm =
@@ -975,7 +983,7 @@ patHollowImp : (_,_ :Str) -> Gender => Number => Str =\xaf,xAf ->
mkIP : Str -> Number -> {s : Str ; n : Number} =
\s,n -> {s = s ; n = n} ;
mkOrd : (_,_ : Str) -> {s : Gender => State => Case => Str ; n : Size } =
mkOrd : (_,_ : Str) -> NumOrdCard =
\aysar,yusra ->
{ s = \\g,s,c =>
case g of {

View File

@@ -2,34 +2,32 @@
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 = {
s = \\c => cn.s ! Weak ! Sg ! Nom ++ i.s ;
a = agrP3 Sg ;
isPron = False
} ;
CNSymbNP det cn xs = let g = cn.g in {
s = \\c => det.s ! g ! c ++ cn.s ! adjfCase det.a c ! det.n ! c ++ xs.s ;
a = agrP3 det.n ;
isPron = False
lin
SymbPN i = {s = \\c => i.s ; g = Masc ; h = NoHum } ; --IL
IntPN i = {s = \\c => i.s ; g = Masc ; h = NoHum } ; --IL
FloatPN i = {s = \\c => i.s ; g = Masc ; h = NoHum } ; --IL
NumPN i = {s = \\c => uttNum i ! Masc ; g = Masc ; h = NoHum } ; --IL
-- CNIntNP cn i = {
-- s = \\c => cn.s ! Sg ! Def ! c ++ uttNum i ! Masc ;
-- a = dummyAgrP3 Sg ;
-- } ;
--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 = {
s = \\c => artDef ! (GSg cn.g) ! c ++ cn.s ! Weak ! Sg ! Nom ++ i.s ! Neutr ! c ;
a = agrP3 Sg ;
isPron = False
s = \\c => cn.s ! Sg ! Def ! c ++ uttNum i ! Masc ;
a = dummyAgrP3 Sg ;
} ;
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
@@ -39,9 +37,13 @@ lin
MkSymb s = s ;
BaseSymb = infixSS "und" ;
BaseSymb = infixSS "und" ; ----
ConsSymb = infixSS "," ;
-}
oper
dummyAgrP3 : Number -> Agr = \n ->
{ pgn = Per3 Masc n ; isPron = False } ;
}