functor
import
Encode FS
export
Agreement
Category
ComplementRoles
ModifierRoles AllRoles
Roles Complements Modifiers
Vprefixes
Marks
LexEncode
define
Agreement = {New Encode.domainProduct
init([[masc fem neut]
[sing plur]
[1 2 3]
[nom acc dat gen]
[def indef none]])}
Category = {New Encode.domainProduct
init([[n pro vinf vfin vpast det part vpref adj adv prep]])}
ComplementRoles = [det subject nominative object dative
zu vpref vp_zu vp_past vp_inf]
ModifierRoles = [adj adv pp_np]
AllRoles = {Append ComplementRoles ModifierRoles}
Roles = {New Encode.domainProduct init([AllRoles])}
Complements = {Roles encode(ComplementRoles $)}
Modifiers = {Roles encode(ModifierRoles $)}
Vprefixes = {New Encode.domainProduct init([[ein]])}
Marks = {New Encode.domainProduct init([[zu vpref haben sein]])}
fun {LexEncode Desc}
for F in {Arity Desc} do
if {Not {Member F [cats agrs comps_req
comps_opt vpref marks aux]}}
then
raise unknownFeature(F Desc) end
end
end
DescCat = Desc.cats
DescAgr = {CondSelect Desc agrs [nil]}
DescReq = {CondSelect Desc comps_req nil}
DescOpt = {CondSelect Desc comps_opt nil}
DescVpf = {CondSelect Desc vpref nil}
DescMrk = {CondSelect Desc marks nil}
DescAux = {CondSelect Desc aux nil}
Cats = {Category encode(DescCat $)}
Agrs = {Agreement encode(DescAgr $)}
Reqs = {Roles encode(DescReq $)}
Opts = {Roles encode(DescOpt $)}
Vpref = {Vprefixes encode(DescVpf $)}
Zmrks = {Marks encode(DescMrk $)}
Aux = {Marks encode(DescAux $)}
if {FS.diff Reqs Complements}\=FS.value.empty then
raise notallcomps(reqs Desc) end
end
if {FS.diff Opts Complements}\=FS.value.empty then
raise notallcomps(opts Desc) end
end
CompsLo = Reqs
CompsHi = {FS.union Reqs Opts}
in
lex(cats : Cats
agrs : Agrs
comps_lo : CompsLo
comps_hi : CompsHi
vpref : Vpref
marks : Zmrks
aux : Aux)
end
end