Encoder of Lexicon Entry

A lexicon entry is specified by a record where each feature maps to a descriptor for the corresponding domain product. A lexicon entry must have at least feature cats. All other features are optional and the encoder provides the obvious default value.

Feature agrs provides a descriptor for a set of agreement tuples. The default value is the set of all agreement tuples. Feature comps_req is a list of required complement roles (default empty). Feature comps_opt is a list of optional complement roles (default empty). vpref is a list of verb prefixes (default empty) and indicates that the full form of the verb has one of these prefixes. aux is a list (default empty) of at most one of haben or sein and indicates that the word is a form of one of these auxiliaries. marks is a list of marks (default empty): this list contains zu if the particle is part of the word, vpref if the separable prefix is not separated, haben (resp. sein) if it requires ``haben'' (resp. ``sein'') as an auxiliary.

function LexEncode takes a specifier for a lexicon entry and returns the corresponding (encoded) lexicon entry. For simplicity in the parser, the lexicon entry contains lower and upper bounds for the set of complements rather than the sets of required and optional complements.

<Entry exports>= <<
LexEncode

<Entry encoder of lexicon entry>=
fun {LexEncode Desc}
   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 $)}
   %%
   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


Denys Duchier
Version 1.2.0 (20010221)