Python LMF library
 All Classes Namespaces Files Functions Variables
pylmflib.pylmflib.output.odt Namespace Reference


def file_read
 Read file contents. More...
def odt_write
 Write a document file. More...

Function Documentation

def pylmflib.pylmflib.output.odt.file_read (   filename)

Read file contents.

filenameThe name of the file with full path containing information to read, for instance the text introduction of the document: 'user/config/introduction.txt'.
A Python string containing read information.

Definition at line 15 of file

def pylmflib.pylmflib.output.odt.odt_write (   object,
  introduction = None,
  lmf2odt = lmf_to_odt,
  items = lambda lexical_entry: lexical_entry.get_lexeme(),
  sort_order = None,
  paradigms = False,
  reverse = False 

Write a document file.

objectThe LMF instance to convert into document output format.
filenameThe name of the document file to write with full path, for instance 'user/output.odt'.
introductionThe name of the text file with full path containing the introduction of the document, for instance 'user/config/introduction.txt'. Default value is None.
lmf2odtA function giving the mapping from LMF representation information that must be written to ODT commands, in a defined order. Default value is 'lmf_to_odt' function defined in 'pylmflib/config/'. Please refer to it as an example.
itemsLambda function giving the item to sort. Default value is 'lambda lexical_entry: lexical_entry.get_lexeme()', which means that the items to sort are lexemes.
sort_orderPython list. Default value is 'None', which means that the document output is alphabetically ordered.
paradigmsA boolean value to introduce paradigms in document or not.
reverseA boolean value to set if a reverse dictionary is wanted.

Definition at line 27 of file