Module references_data :: Class Creferences
[hide private]
[frames] | no frames]

Class Creferences

source code

This class encapsulates the references objects in KAF/NAF

Instance Methods [hide private]
 
__init__(self, node=None)
Constructor of the object
source code
Cspan
__iter__(self)
Iterator that returns all the span objects in the reference
source code
 
add_span(self, term_span)
Adds a list of term ids a new span in the references
source code
xml Element
get_node(self)
Returns the node of the element
source code
Cspan
get_span(self)
Returns the span object of the reference
source code
 
set_span(self, this_span)
Sets the span for the lemma
source code
Method Details [hide private]

__init__(self, node=None)
(Constructor)

source code 

Constructor of the object

Parameters:
  • node (xml Element or None (to create and empty one)) - this is the node of the element. If it is None it will create a new object

__iter__(self)

source code 

Iterator that returns all the span objects in the reference

Returns: Cspan
list of span objects (iterator)

add_span(self, term_span)

source code 

Adds a list of term ids a new span in the references

Parameters:
  • term_span (list) - list of term ids

get_node(self)

source code 

Returns the node of the element

Returns: xml Element
the node of the element

get_span(self)

source code 

Returns the span object of the reference

Returns: Cspan
the term span

set_span(self, this_span)

source code 

Sets the span for the lemma

Parameters:
  • this_span (Cspan) - lemma identifier