Python LMF library
 All Classes Namespaces Files Functions Variables
Public Member Functions | Public Attributes | List of all members
pylmflib.pylmflib.core.lexicon.Lexicon Class Reference

"Lexicon is a class containing all the lexical entries of a given language within the entire resource." (LMF) More...

Public Member Functions

def __init__
 Constructor. More...
 
def __del__
 Destructor. More...
 
def set_id
 Set lexicon identifier. More...
 
def get_id
 Get identifier. More...
 
def set_entrySource
 Set lexicon entry source. More...
 
def get_entrySource
 Get entry source. More...
 
def set_language
 Set lexicon language. More...
 
def get_language
 Get language. More...
 
def set_languageScript
 Set lexicon language script. More...
 
def get_languageScript
 Get language script. More...
 
def set_label
 Set lexicon label. More...
 
def get_label
 Get label. More...
 
def set_lexiconType
 Set lexicon type. More...
 
def get_lexiconType
 Get lexicon type. More...
 
def set_vowelHarmony
 
def get_vowelHarmony
 
def set_localPath
 Set lexicon local path. More...
 
def get_localPath
 Get lexicon local path. More...
 
def get_lexical_entries
 Get all lexical entries maintained by the lexicon. More...
 
def add_lexical_entry
 Add a lexical entry to the lexicon. More...
 
def remove_lexical_entry
 Remove a lexical entry from the lexicon. More...
 
def count_lexical_entries
 Count number of lexical entries of the lexicon. More...
 
def sort_homonym_numbers
 Sort similar given items of lexical entries contained in the lexicon according to their homonym number. More...
 
def sort_lexical_entries
 Sort given items of lexical entries contained in the lexicon according to a certain order. More...
 
def find_lexical_entries
 Find all lexical entries which characteristics meet the given condition. More...
 
def check_cross_references
 Check all cross-references in the lexicon. More...
 
def reset_check
 Reset boolean to be able to check all cross-references in the lexicon again. More...
 
def convert_to_latex
 

Public Attributes

 language
 
 languageScript
 
 label
 
 lexiconType
 
 entrySource
 
 vowelHarmony
 
 localPath
 
 lexical_entry
 All LexicalEntry instances are maintained by Lexicon There is one or more LexicalEntry instances per Lexicon. More...
 
 id
 

Detailed Description

"Lexicon is a class containing all the lexical entries of a given language within the entire resource." (LMF)

Definition at line 9 of file lexicon.py.

Constructor & Destructor Documentation

def pylmflib.pylmflib.core.lexicon.Lexicon.__init__ (   self,
  id = None 
)

Constructor.

Lexicon instances are owned by LexicalResource.

Returns
A Lexicon instance.

Definition at line 12 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.__del__ (   self)

Destructor.

Release LexicalEntry instances.

Definition at line 31 of file lexicon.py.

Member Function Documentation

def pylmflib.pylmflib.core.lexicon.Lexicon.add_lexical_entry (   self,
  lexical_entry 
)

Add a lexical entry to the lexicon.

Parameters
lexical_entryA LexicalEntry instance to add to the Lexicon.
Returns
Lexicon instance.

Definition at line 149 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.check_cross_references (   self)

Check all cross-references in the lexicon.

Fill the private attribute '__lexicalEntry' of each RelatedForm instance for all lexical entries.

Returns
Lexicon instance.

Definition at line 283 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.convert_to_latex (   self)
This method converts the lexicon into LaTeX format.

Definition at line 349 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.count_lexical_entries (   self)

Count number of lexical entries of the lexicon.

Returns
The number of lexical entries without duplicates maintained by the lexicon.

Definition at line 165 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.find_lexical_entries (   self,
  filter 
)

Find all lexical entries which characteristics meet the given condition.

Parameters
filterFunction or lambda function taking a lexical entry as argument, and returning True or False; for instance 'lambda lexical_entry: lexical_entry.get_lexeme() == "Hello"'.
Returns
A Python list of LexicalEntry instances.

Definition at line 272 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.get_entrySource (   self)

Get entry source.

Returns
Lexicon attribute 'entrySource'.

Definition at line 61 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.get_id (   self)

Get identifier.

Returns
Lexicon attribute 'id'.

Definition at line 47 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.get_label (   self)

Get label.

Returns
Lexicon attribute 'label'.

Definition at line 103 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.get_language (   self)

Get language.

Returns
Lexicon attribute 'language'.

Definition at line 75 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.get_languageScript (   self)

Get language script.

Returns
Lexicon attribute 'languageScript'.

Definition at line 89 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.get_lexical_entries (   self)

Get all lexical entries maintained by the lexicon.

Returns
A Python set of lexical entries.

Definition at line 143 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.get_lexiconType (   self)

Get lexicon type.

Returns
Lexicon attribute 'lexiconType'.

Definition at line 117 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.get_localPath (   self)

Get lexicon local path.

Returns
Lexicon attribute 'localPath'.

Definition at line 137 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.get_vowelHarmony (   self)

Definition at line 126 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.remove_lexical_entry (   self,
  lexical_entry 
)

Remove a lexical entry from the lexicon.

Parameters
lexical_entryThe LexicalEntry instance to remove from the Lexicon.
Returns
Lexicon instance.

Definition at line 157 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.reset_check (   self)

Reset boolean to be able to check all cross-references in the lexicon again.

Reset the private attribute '__checked'.

Returns
Lexicon instance.

Definition at line 341 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.set_entrySource (   self,
  entry_source 
)

Set lexicon entry source.

Parameters
entry_sourceThe entry source to set.
Returns
Lexicon instance.

Definition at line 53 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.set_id (   self,
  id 
)

Set lexicon identifier.

Parameters
idThe identifier to set.
Returns
Lexicon instance.

Definition at line 39 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.set_label (   self,
  label 
)

Set lexicon label.

Parameters
labelThe label to set.
Returns
Lexicon instance.

Definition at line 95 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.set_language (   self,
  language 
)

Set lexicon language.

Parameters
languageThe language to set.
Returns
Lexicon instance.

Definition at line 67 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.set_languageScript (   self,
  language_script 
)

Set lexicon language script.

Parameters
language_scriptThe language script to set.
Returns
Lexicon instance.

Definition at line 81 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.set_lexiconType (   self,
  lexicon_type 
)

Set lexicon type.

Parameters
lexicon_typeThe lexicon type to set.
Returns
Lexicon instance.

Definition at line 109 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.set_localPath (   self,
  local_path 
)

Set lexicon local path.

Parameters
local_pathThe absolute path to audio files to set.
Returns
Lexicon instance.

Definition at line 129 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.set_vowelHarmony (   self,
  vowel_harmony 
)

Definition at line 123 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.sort_homonym_numbers (   self,
  items = lambda lexical_entry: lexical_entry.get_lexeme(),
  condition = lambda lexical_entry: True 
)

Sort similar given items of lexical entries contained in the lexicon according to their homonym number.

Parameters
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.
conditionLambda function giving a condition to apply classification.
Returns
The sorted Python list of lexical entries.

Definition at line 171 of file lexicon.py.

def pylmflib.pylmflib.core.lexicon.Lexicon.sort_lexical_entries (   self,
  items = lambda lexical_entry: lexical_entry.get_lexeme(),
  sort_order = None,
  comparison = None 
)

Sort given items of lexical entries contained in the lexicon according to a certain order.

Parameters
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_orderDefault value is 'None', which means that the lexicographical ordering uses the ASCII ordering.
comparisonFunction to compare items. If 'None', a default function to compare character by character is provided.
Returns
The sorted Python list of lexical entries.

Definition at line 201 of file lexicon.py.

Member Data Documentation

pylmflib.pylmflib.core.lexicon.Lexicon.entrySource

Definition at line 22 of file lexicon.py.

pylmflib.pylmflib.core.lexicon.Lexicon.id

Definition at line 44 of file lexicon.py.

pylmflib.pylmflib.core.lexicon.Lexicon.label

Definition at line 20 of file lexicon.py.

pylmflib.pylmflib.core.lexicon.Lexicon.language

Definition at line 18 of file lexicon.py.

pylmflib.pylmflib.core.lexicon.Lexicon.languageScript

Definition at line 19 of file lexicon.py.

pylmflib.pylmflib.core.lexicon.Lexicon.lexical_entry

All LexicalEntry instances are maintained by Lexicon There is one or more LexicalEntry instances per Lexicon.

Definition at line 27 of file lexicon.py.

pylmflib.pylmflib.core.lexicon.Lexicon.lexiconType

Definition at line 21 of file lexicon.py.

pylmflib.pylmflib.core.lexicon.Lexicon.localPath

Definition at line 24 of file lexicon.py.

pylmflib.pylmflib.core.lexicon.Lexicon.vowelHarmony

Definition at line 23 of file lexicon.py.


The documentation for this class was generated from the following file: