forked from GitHub/gf-rgl
(Hun) Add possibility to prepose Advs
This commit is contained in:
@@ -12,7 +12,8 @@ lin
|
|||||||
|
|
||||||
-- : Prep -> NP -> Adv ;
|
-- : Prep -> NP -> Adv ;
|
||||||
PrepNP prep np = {
|
PrepNP prep np = {
|
||||||
s = applyAdp prep np
|
s = applyAdp prep np ;
|
||||||
|
isPre = False ;
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Adverbs can be modified by 'adadjectives', just like adjectives.
|
-- Adverbs can be modified by 'adadjectives', just like adjectives.
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
concrete CatHun of Cat = CommonX ** open ResHun, Prelude in {
|
concrete CatHun of Cat = CommonX - [Adv] ** open ResHun, Prelude in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
@@ -118,6 +118,8 @@ concrete CatHun of Cat = CommonX ** open ResHun, Prelude in {
|
|||||||
N3 = ResHun.Noun ;
|
N3 = ResHun.Noun ;
|
||||||
PN = ResHun.NounPhrase ;
|
PN = ResHun.NounPhrase ;
|
||||||
|
|
||||||
|
Adv = {s : Str ; isPre : Bool} ;
|
||||||
|
|
||||||
linref
|
linref
|
||||||
CN = linCN ;
|
CN = linCN ;
|
||||||
|
|
||||||
|
|||||||
@@ -3,12 +3,20 @@ concrete ConjunctionHun of Conjunction =
|
|||||||
|
|
||||||
-- Adverb and other simple {s : Str} types.
|
-- Adverb and other simple {s : Str} types.
|
||||||
lincat
|
lincat
|
||||||
[Adv],[AdV],[IAdv],[S] = {s1,s2 : Str} ;
|
[AdV],[IAdv],[S] = {s1,s2 : Str} ;
|
||||||
|
|
||||||
lin
|
lin
|
||||||
BaseAdv, BaseAdV, BaseIAdv, BaseS = twoSS ;
|
BaseAdV, BaseIAdv, BaseS = twoSS ;
|
||||||
ConsAdv, ConsAdV, ConsIAdv, ConsS = consrSS comma ;
|
ConsAdV, ConsIAdv, ConsS = consrSS comma ;
|
||||||
ConjAdv, ConjAdV, ConjIAdv, ConjS = conjunctDistrSS ;
|
ConjAdV, ConjIAdv, ConjS = conjunctDistrSS ;
|
||||||
|
|
||||||
|
lincat
|
||||||
|
[Adv] = {s1,s2 : Str ; isPre : Bool} ;
|
||||||
|
|
||||||
|
lin
|
||||||
|
BaseAdv x y = y ** twoSS x y ;
|
||||||
|
ConsAdv x xs = xs ** consrSS comma x xs ;
|
||||||
|
ConjAdv co xs = xs ** conjunctDistrSS co xs ;
|
||||||
|
|
||||||
-- Adjectival phrases
|
-- Adjectival phrases
|
||||||
lincat
|
lincat
|
||||||
|
|||||||
@@ -9,10 +9,10 @@ concrete GrammarHun of Grammar =
|
|||||||
RelativeHun,
|
RelativeHun,
|
||||||
ConjunctionHun,
|
ConjunctionHun,
|
||||||
PhraseHun,
|
PhraseHun,
|
||||||
TextX,
|
TextX - [Adv],
|
||||||
StructuralHun,
|
StructuralHun,
|
||||||
IdiomHun,
|
IdiomHun,
|
||||||
TenseX
|
TenseX - [Adv]
|
||||||
** {
|
** {
|
||||||
|
|
||||||
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
flags startcat = Phr ; unlexer = text ; lexer = text ;
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
|
concrete NounHun of Noun = CatHun ** open
|
||||||
|
ResHun, Prelude, Coordination in {
|
||||||
|
|
||||||
flags optimize=all_subs ;
|
flags optimize=all_subs ;
|
||||||
|
|
||||||
@@ -40,7 +41,13 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
|
|||||||
|
|
||||||
-- : NP -> Adv -> NP ; -- Paris today
|
-- : NP -> Adv -> NP ; -- Paris today
|
||||||
AdvNP np adv = np ** {
|
AdvNP np adv = np ** {
|
||||||
s = \\c => np.s ! c ++ adv.s ;
|
s = \\c => case adv.isPre of {
|
||||||
|
True => adv.s ++ np.s ! c ;
|
||||||
|
False => np.s ! c ++ adv.s } ;
|
||||||
|
-- compl = \\nc => case adv.isPre of {
|
||||||
|
-- True => np.compl ! nc ;
|
||||||
|
-- False => np.compl ! nc ++ adv.s } ;
|
||||||
|
|
||||||
} ;
|
} ;
|
||||||
-- : NP -> Adv -> NP ; -- boys, such as ..
|
-- : NP -> Adv -> NP ; -- boys, such as ..
|
||||||
ExtAdvNP np adv = np ** {
|
ExtAdvNP np adv = np ** {
|
||||||
@@ -202,8 +209,9 @@ concrete NounHun of Noun = CatHun ** open ResHun, Prelude, Coordination in {
|
|||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- : CN -> Adv -> CN ;
|
-- : CN -> Adv -> CN ;
|
||||||
AdvCN cn adv = cn ** {
|
AdvCN cn adv = case adv.isPre of {
|
||||||
compl = \\n,c => cn.compl ! n ! c ++ adv.s
|
True => AdjCN (invarAP adv.s) cn ;
|
||||||
|
False => cn ** {compl = \\n,c => cn.compl ! n ! c ++ adv.s}
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
-- Nouns can also be modified by embedded sentences and questions.
|
-- Nouns can also be modified by embedded sentences and questions.
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ oper
|
|||||||
-- lin Subj { } ;
|
-- lin Subj { } ;
|
||||||
|
|
||||||
mkAdv : Str -> Adv
|
mkAdv : Str -> Adv
|
||||||
= \s -> lin Adv {s = s} ;
|
= \s -> lin Adv {s = s ; isPre=False} ;
|
||||||
|
|
||||||
mkAdV : Str -> AdV
|
mkAdV : Str -> AdV
|
||||||
= \s -> lin AdV {s = s} ;
|
= \s -> lin AdV {s = s} ;
|
||||||
|
|||||||
@@ -336,6 +336,8 @@ oper
|
|||||||
in adj + plural
|
in adj + plural
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
invarAP : Str -> AdjPhrase = \s -> emptyAP ** {s = \\_ => s} ;
|
||||||
|
|
||||||
-- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Adjectives
|
-- https://en.wikisource.org/wiki/Simplified_Grammar_of_the_Hungarian_Language/Adjectives
|
||||||
comparAdj : Str -> Str = \stem ->
|
comparAdj : Str -> Str = \stem ->
|
||||||
case stem of {
|
case stem of {
|
||||||
|
|||||||
@@ -24,16 +24,16 @@ oper
|
|||||||
lin
|
lin
|
||||||
-- : CN -> Int -> NP
|
-- : CN -> Int -> NP
|
||||||
CNIntNP cn i = NH.MassNP (cn ** {
|
CNIntNP cn i = NH.MassNP (cn ** {
|
||||||
s = \\n,c => cn.s ! n ! c ++ i.s}) ;
|
compl = \\n,c => cn.compl ! n ! c ++ i.s}) ;
|
||||||
|
|
||||||
-- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
|
-- : Det -> CN -> [Symb] -> NP ; -- (the) (2) numbers x and y
|
||||||
CNSymbNP det cn xs =
|
CNSymbNP det cn xs =
|
||||||
let cnSymb : CN = cn ** {s = \\n,c => cn.s ! n ! c ++ xs.s}
|
let cnSymb : CN = cn ** {compl = \\n,c => cn.compl ! n ! c ++ xs.s}
|
||||||
in NH.DetCN det cnSymb ;
|
in NH.DetCN det cnSymb ;
|
||||||
|
|
||||||
-- : CN -> Card -> NP ; -- level five ; level 5
|
-- : CN -> Card -> NP ; -- level five ; level 5
|
||||||
CNNumNP cn i = NH.MassNP (cn ** {
|
CNNumNP cn i = NH.MassNP (cn ** {
|
||||||
s = \\n,c => cn.s ! n ! c ++ i.s ! Indep}) ;
|
compl = \\n,c => cn.compl ! n ! c ++ i.s ! Indep}) ;
|
||||||
|
|
||||||
-- : Symb -> S ;
|
-- : Symb -> S ;
|
||||||
SymbS sy = sy ;
|
SymbS sy = sy ;
|
||||||
|
|||||||
Reference in New Issue
Block a user