mirror of
https://github.com/GrammaticalFramework/gf-rgl.git
synced 2026-05-27 17:08:54 -06:00
Hrv: enough to implement NLG experiment, but bogus in some places
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
--# -path=.:../slovak:../common:../abstract:../prelude
|
--# -path=.:../slovak:../common:../abstract:../prelude
|
||||||
|
|
||||||
resource TryHrv = SyntaxHrv, LexiconHrv, ParadigmsHrv -[mkAdv, mkDet,mkQuant]**
|
resource TryHrv = SyntaxHrv, LexiconHrv, ParadigmsHrv -[mkAdv, mkAdN, mkOrd, mkDet, mkQuant]**
|
||||||
open (P = ParadigmsHrv) in {
|
open (P = ParadigmsHrv) in {
|
||||||
|
|
||||||
-- oper
|
-- oper
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ concrete AdjectiveHrv of Adjective = CatHrv ** open ResHrv, Prelude in {
|
|||||||
|
|
||||||
AdAP ada ap = ap ** {s = \\g,n,c => ada.s ++ ap.s ! g ! n ! c} ;
|
AdAP ada ap = ap ** {s = \\g,n,c => ada.s ++ ap.s ! g ! n ! c} ;
|
||||||
|
|
||||||
--AW2 AdjOrd
|
AdjOrd a = adjFormsAdjective a ** {isPost = False} ;
|
||||||
|
|
||||||
ComplA2 a np =
|
ComplA2 a np =
|
||||||
let ap = adjFormsAdjective a
|
let ap = adjFormsAdjective a
|
||||||
|
|||||||
@@ -5,5 +5,5 @@ lin
|
|||||||
PrepNP prep np = {
|
PrepNP prep np = {
|
||||||
s = prep.s ++ np.prep ! prep.c
|
s = prep.s ++ np.prep ! prep.c
|
||||||
} ;
|
} ;
|
||||||
|
AdnCAdv a = a ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ concrete CatHrv of Cat =
|
|||||||
Det = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ; -- can contain a numeral, therefore NumSize
|
Det = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ; -- can contain a numeral, therefore NumSize
|
||||||
Quant = {s : Gender => Number => Case => Str} ; -- same as AP
|
Quant = {s : Gender => Number => Case => Str} ; -- same as AP
|
||||||
Num = Determiner ;
|
Num = Determiner ;
|
||||||
Card = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ;
|
Card = Determiner ; -- {s : Gender => Case => Str ; size : NumSize} ;
|
||||||
|
Ord = AdjForms ;
|
||||||
Pron = PronForms ** {poss : AdjForms} ;
|
Pron = PronForms ** {poss : AdjForms} ;
|
||||||
|
|
||||||
Adv = {s : Str} ;
|
Adv = {s : Str} ;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
concrete ExtendHrv of Extend = CatHrv **
|
concrete ExtendHrv of Extend = CatHrv **
|
||||||
ExtendFunctor - [
|
ExtendFunctor - [
|
||||||
ReflPossPron
|
--- ReflPossPron
|
||||||
|
CardCNCard
|
||||||
---- constant not found (yet)
|
---- constant not found (yet)
|
||||||
,youPolFem_Pron
|
,youPolFem_Pron
|
||||||
,UttVPShort
|
,UttVPShort
|
||||||
@@ -34,6 +35,9 @@ in {
|
|||||||
|
|
||||||
---lin ReflPossPron = justDemPronFormsAdjective reflPossessivePron ;
|
---lin ReflPossPron = justDemPronFormsAdjective reflPossessivePron ;
|
||||||
|
|
||||||
--AW2 CardCNCard
|
lin CardCNCard card cn = {
|
||||||
|
s = \\g,c => card.s ! g ! c ++ numSizeForm cn.s card.size c ;
|
||||||
|
size = NS_20_
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,13 @@
|
|||||||
concrete IdiomHrv of Idiom = CatHrv ** open Prelude, ResHrv in {
|
concrete IdiomHrv of Idiom = CatHrv ** open Prelude, ResHrv in {
|
||||||
|
|
||||||
--AW2 ExistNP
|
lin
|
||||||
--AW2 ExistNPAdv
|
ExistNP np = { ---- TODO verify this
|
||||||
|
subj = np.s ! Nom ;
|
||||||
|
verb = biti_VerbForms ; ---- TODO: jesam
|
||||||
|
clit, compl = [] ;
|
||||||
|
a = np.a
|
||||||
|
} ;
|
||||||
|
|
||||||
|
ExistNPAdv np adv = ExistNP np ** {compl = adv.s} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,10 +3,7 @@ resource MissingHrv = open GrammarHrv, SymbolHrv, Prelude, PredefCnc in {
|
|||||||
-- temporary definitions to enable the compilation of RGL API
|
-- temporary definitions to enable the compilation of RGL API
|
||||||
oper AAnter : Ant = notYet "AAnter" ;
|
oper AAnter : Ant = notYet "AAnter" ;
|
||||||
oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ;
|
oper AdAdv : AdA -> Adv -> Adv = notYet "AdAdv" ;
|
||||||
oper AdNum : AdN -> Card -> Card = notYet "AdNum" ;
|
|
||||||
oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ;
|
oper AdVVP : AdV -> VP -> VP = notYet "AdVVP" ;
|
||||||
oper AdjOrd : Ord -> AP = notYet "AdjOrd" ;
|
|
||||||
oper AdnCAdv : CAdv -> AdN = notYet "AdnCAdv" ;
|
|
||||||
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
|
oper AdvIAdv : IAdv -> Adv -> IAdv = notYet "AdvIAdv" ;
|
||||||
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
|
oper AdvIP : IP -> Adv -> IP = notYet "AdvIP" ;
|
||||||
oper AdvS : Adv -> S -> S = notYet "AdvS" ;
|
oper AdvS : Adv -> S -> S = notYet "AdvS" ;
|
||||||
@@ -26,13 +23,11 @@ oper ComplVA : VA -> AP -> VP = notYet "ComplVA" ;
|
|||||||
oper ComplVQ : VQ -> QS -> VP = notYet "ComplVQ" ;
|
oper ComplVQ : VQ -> QS -> VP = notYet "ComplVQ" ;
|
||||||
oper ComplVS : VS -> S -> VP = notYet "ComplVS" ;
|
oper ComplVS : VS -> S -> VP = notYet "ComplVS" ;
|
||||||
oper ComplVV : VV -> VP -> VP = notYet "ComplVV" ;
|
oper ComplVV : VV -> VP -> VP = notYet "ComplVV" ;
|
||||||
oper DetNP : Det -> NP = notYet "DetNP" ;
|
|
||||||
oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ;
|
oper DetQuantOrd : Quant -> Num -> Ord -> Det = notYet "DetQuantOrd" ;
|
||||||
oper EmbedQS : QS -> SC = notYet "EmbedQS" ;
|
oper EmbedQS : QS -> SC = notYet "EmbedQS" ;
|
||||||
oper EmbedS : S -> SC = notYet "EmbedS" ;
|
oper EmbedS : S -> SC = notYet "EmbedS" ;
|
||||||
oper EmbedVP : VP -> SC = notYet "EmbedVP" ;
|
oper EmbedVP : VP -> SC = notYet "EmbedVP" ;
|
||||||
oper ExistIP : IP -> QCl = notYet "ExistIP" ;
|
oper ExistIP : IP -> QCl = notYet "ExistIP" ;
|
||||||
oper ExistNP : NP -> Cl = notYet "ExistNP" ;
|
|
||||||
oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ;
|
oper FunRP : Prep -> NP -> RP -> RP = notYet "FunRP" ;
|
||||||
oper GenericCl : VP -> Cl = notYet "GenericCl" ;
|
oper GenericCl : VP -> Cl = notYet "GenericCl" ;
|
||||||
oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ;
|
oper IdetCN : IDet -> CN -> IP = notYet "IdetCN" ;
|
||||||
@@ -43,7 +38,6 @@ oper ImpVP : VP -> Imp = notYet "ImpVP" ;
|
|||||||
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
|
oper ImpersCl : VP -> Cl = notYet "ImpersCl" ;
|
||||||
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
|
oper OrdDigits : Digits -> Ord = notYet "OrdDigits" ;
|
||||||
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
|
oper OrdNumeral : Numeral -> Ord = notYet "OrdNumeral" ;
|
||||||
oper OrdSuperl : A -> Ord = notYet "OrdSuperl" ;
|
|
||||||
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
|
oper PPartNP : NP -> V2 -> NP = notYet "PPartNP" ;
|
||||||
oper PassV2 : V2 -> VP = notYet "PassV2" ;
|
oper PassV2 : V2 -> VP = notYet "PassV2" ;
|
||||||
oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ;
|
oper PositAdvAdj : A -> Adv = notYet "PositAdvAdj" ;
|
||||||
@@ -76,7 +70,6 @@ oper SlashVV : VV -> VPSlash -> VPSlash = notYet "SlashVV" ;
|
|||||||
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
|
oper SubjS : Subj -> S -> Adv = notYet "SubjS" ;
|
||||||
oper TCond : Tense = notYet "TCond" ;
|
oper TCond : Tense = notYet "TCond" ;
|
||||||
oper TFut : Tense = notYet "TFut" ;
|
oper TFut : Tense = notYet "TFut" ;
|
||||||
oper TPast : Tense = notYet "TPast" ;
|
|
||||||
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
|
oper Use2N3 : N3 -> N2 = notYet "Use2N3" ;
|
||||||
oper UseN2 : N2 -> CN = notYet "UseN2" ;
|
oper UseN2 : N2 -> CN = notYet "UseN2" ;
|
||||||
oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ;
|
oper UseSlash : Temp -> Pol -> ClSlash -> SSlash = notYet "UseSlash" ;
|
||||||
|
|||||||
@@ -11,6 +11,12 @@ lin
|
|||||||
hasClit = False ;
|
hasClit = False ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
DetNP det = {
|
||||||
|
s,prep,clit = \\c => det.s ! Neutr ! c ;
|
||||||
|
a = numSizeAgr Neutr det.size P3 ;
|
||||||
|
hasClit = False ;
|
||||||
|
} ;
|
||||||
|
|
||||||
MassNP cn = {
|
MassNP cn = {
|
||||||
s,prep,clit = \\c => cn.s ! Sg ! c ;
|
s,prep,clit = \\c => cn.s ! Sg ! c ;
|
||||||
a = Ag cn.g Sg P3 ;
|
a = Ag cn.g Sg P3 ;
|
||||||
@@ -88,9 +94,8 @@ lin
|
|||||||
size = nu.size
|
size = nu.size
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
--AW2 AdNum
|
AdNum adn card = card ** {s = \\g,c => adn.s ++ card.s ! g ! c} ;
|
||||||
--AW2 PossNP
|
OrdSuperl a = a ; ---- TODO superl
|
||||||
--AW2 OrdSuperl
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,6 +98,18 @@ oper
|
|||||||
zenaNForms : Str -> NForms
|
zenaNForms : Str -> NForms
|
||||||
= zenaN ;
|
= zenaN ;
|
||||||
|
|
||||||
|
mkPN = overload {
|
||||||
|
mkPN : Str -> PN
|
||||||
|
= \s ->
|
||||||
|
let
|
||||||
|
nf = smartLexNoun s ;
|
||||||
|
n = nounFormsNoun nf nf.g
|
||||||
|
in lin PN {
|
||||||
|
s = \\c => n.s ! Sg ! c ; ---- TODO check this
|
||||||
|
g = nf.g
|
||||||
|
} ;
|
||||||
|
} ;
|
||||||
|
|
||||||
---------------------
|
---------------------
|
||||||
-- Adjectives
|
-- Adjectives
|
||||||
|
|
||||||
@@ -170,7 +182,16 @@ oper
|
|||||||
mkConj : Str -> Conj
|
mkConj : Str -> Conj
|
||||||
= \s -> lin Conj {s1 = [] ; s2 = s} ;
|
= \s -> lin Conj {s1 = [] ; s2 = s} ;
|
||||||
|
|
||||||
--AW2 mkAdN
|
mkAdN : Str -> AdN
|
||||||
--AW2 mkOrd
|
= \s -> lin AdN {s = s} ;
|
||||||
|
|
||||||
|
mkOrd : Str -> Ord
|
||||||
|
= \s -> lin Ord (velikA s) ;
|
||||||
|
|
||||||
|
ifPluralNP : NP -> Bool
|
||||||
|
= \np -> case np.a of {
|
||||||
|
Ag _ Pl _ => True ;
|
||||||
|
_ => False
|
||||||
|
} ;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ lin
|
|||||||
} ;
|
} ;
|
||||||
ASimul = {s = [] ; t = CTPres} ;
|
ASimul = {s = [] ; t = CTPres} ;
|
||||||
TPres = {s = [] ; t = CTPres} ;
|
TPres = {s = [] ; t = CTPres} ;
|
||||||
|
TPast = {s = [] ; t = CTPast} ;
|
||||||
TTAnt t a = {s = t.s ++ a.s ; t = t.t} ; ----
|
TTAnt t a = {s = t.s ++ a.s ; t = t.t} ; ----
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user