Python LMF library
 All Classes Namespaces Files Functions Variables
Public Member Functions | Public Attributes | List of all members
pylmflib.pylmflib.mrd.context.Context Class Reference

"Context is a class representing a text string that provides authentic context for the use of the word form managed by the Lemma. This class is to be distinguished from Sense Example." (LMF) More...

Public Member Functions

def __init__
 Constructor. More...
 
def __del__
 Destructor. More...
 
def set_type
 Set context type. More...
 
def get_type
 Get context type. More...
 
def create_text_representation
 Create a text representation. More...
 
def add_text_representation
 Add a text representation to the context. More...
 
def get_text_representations
 Get all text representations maintained by the context. More...
 
def get_last_text_representation
 Get the previously registered TextRepresentation instance. More...
 
def find_written_forms
 Find written forms. More...
 
def get_comments
 Get comments. More...
 
def set_written_form
 Set text representation written form, language and script. More...
 
def set_comment
 Set text representation comment. More...
 
def get_speakerID
 Get related speaker identifier. More...
 
def get_speaker
 Get speaker. More...
 

Public Attributes

 language
 
 type
 
 text_representation
 TextRepresentation instances are owned by Context There is zero to many TextRepresentation instances per Context. More...
 
 targets
 

Detailed Description

"Context is a class representing a text string that provides authentic context for the use of the word form managed by the Lemma. This class is to be distinguished from Sense Example." (LMF)

Definition at line 10 of file context.py.

Constructor & Destructor Documentation

def pylmflib.pylmflib.mrd.context.Context.__init__ (   self,
  speakerID = None 
)

Constructor.

Context instances are owned by Sense.

Parameters
speakerIDRelated speaker identifier. If not provided, default value is None.
Returns
A Context instance.

Definition at line 13 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.__del__ (   self)

Destructor.

Release TextRepresentation instances.

Definition at line 30 of file context.py.

Member Function Documentation

def pylmflib.pylmflib.mrd.context.Context.add_text_representation (   self,
  text_representation 
)

Add a text representation to the context.

Parameters
text_representationThe TextRepresentation instance to add to the context.
Returns
Context instance.

Definition at line 65 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.create_text_representation (   self)

Create a text representation.

Returns
TextRepresentation instance.

Definition at line 59 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.find_written_forms (   self,
  language = None,
  script_name = None 
)

Find written forms.

This attribute is owned by TextRepresentation.

Parameters
languageIf given, the language to consider to retrieve the written form.
script_nameIf given, the script to consider to retrieve the written form.
Returns
A Python list of found TextRepresentation attributes 'writtenForm'.

Definition at line 86 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.get_comments (   self)

Get comments.

This attribute is owned by TextRepresentation.

Returns
A Python list of found TextRepresentation attributes 'comment'.

Definition at line 100 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.get_last_text_representation (   self)

Get the previously registered TextRepresentation instance.

Returns
The last element of Context attribute 'text_representation'.

Definition at line 79 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.get_speaker (   self)

Get speaker.

Returns
Context private attribute '__speaker'.

Definition at line 150 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.get_speakerID (   self)

Get related speaker identifier.

Returns
Context attribute 'targets'.

Definition at line 144 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.get_text_representations (   self)

Get all text representations maintained by the context.

Returns
A Python list of text representations.

Definition at line 73 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.get_type (   self)

Get context type.

Returns
Context attribute 'type'.

Definition at line 53 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.set_comment (   self,
  comment 
)

Set text representation comment.

Attribute 'comment' is owned by TextRepresentation.

Parameters
commentThe comment to set.
Returns
Context instance.

Definition at line 128 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.set_type (   self,
  type 
)

Set context type.

Parameters
typeType of text representations, in range 'type_example_range' defined in 'common/range.py'.
Returns
Context instance.

Definition at line 40 of file context.py.

def pylmflib.pylmflib.mrd.context.Context.set_written_form (   self,
  written_form,
  language = None,
  script_name = None 
)

Set text representation written form, language and script.

Attributes 'writtenForm', 'language' and 'scriptName' are owned by TextRepresentation.

Parameters
written_formThe written form to set.
languageLanguage of the written form.
script_nameThe name of the script used to write the form, e.g. devanagari.
Returns
Context instance.

Definition at line 111 of file context.py.

Member Data Documentation

pylmflib.pylmflib.mrd.context.Context.language

Definition at line 19 of file context.py.

pylmflib.pylmflib.mrd.context.Context.targets

Definition at line 25 of file context.py.

pylmflib.pylmflib.mrd.context.Context.text_representation

TextRepresentation instances are owned by Context There is zero to many TextRepresentation instances per Context.

Definition at line 23 of file context.py.

pylmflib.pylmflib.mrd.context.Context.type

Definition at line 20 of file context.py.


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