Skip to content

LexcCompiler

eaxelson edited this page Nov 29, 2017 · 11 revisions

class LexcCompiler

A compiler holding information contained in lexc style lexicons. A single LexcCompiler can be extended by adding entries to it, but little else can be done with it. It is sufficient to implement clone of lexc.

The easiest way to create transducers from lexc files is probably the function hfst.compile_lexc_file.


__init__ (self)

Create a lexc compiler for unspecified transducer format.


__init__ (self, impl)

Create a lexc compiler with impl as transducer format.


__init__ (self, impl, withFlags)

Create a lexc compiler with impl as transducer format.


parse (infile)

Compile lexc description from infile into current compiler.


parse (filename)

Compile lexc description from file filename into current compiler.


setVerbosity (verbose)

Set verbosity options. When verbose is true, LexcCompiler will output the messages that Xerox lexc compiler does.

TODO: document

  • isQuiet()
  • setTreatWarningsAsErrors(value)
  • areWarningsTreatedAsErrors()
  • setAllowMultipleSublexiconDefinitions(value)
  • setWithFlags(value)
  • setMinimizeFlags(value)
  • setRenameFlags(value)

addAlphabet (alphabet)

Add alphabet to multicharacter symbol set. These symbols may be used for regular expression ? for backends that do not support open alphabets.


addNoFlag (lexname)

todo


setCurrentLexiconName (lexicon_name)

Set current processing lexicon name to lexicon_name.


addStringEntry (entry, continuation, weight)

Add entry defined by a entry to current lexicon, pointing to continuation weighing weight to current lexicon.


addStringPairEntry (upper, lower, continuation, weight)

Add entry defined by upper:lower, pointing to continuation weighing weight to current lexicon.


addXreEntry (xre, continuation, weight)

Add entry defined by regular expression xre, pointing to continuation weighing weight to current lexicon.


addXreDefinition (name, xre)

Add macro definition named name matching regular expression xre to known xerox regular expressions.


setInitialLexiconName (lexicon_name)

Set start lexicon's name to lexicon_name.


compileLexical ()

Create final usable version of current lexicons and entries. Return: HfstTransducer pointer.


printConnectedness ()

Check that current morphotax is connected and print anomalies. Works like xerox lexc, for compatibility.

Clone this wiki locally