Module span_data :: Class Cspan
[hide private]
[frames] | no frames]

Class Cspan

source code

This class encapsulates a span object in KAF/NAF

Instance Methods [hide private]
 
__get_target_nodes(self) source code
 
__init__(self, node=None)
Constructor of the object
source code
Ctarget
__iter__(self)
Iterator taht returns the target objects
source code
 
__str__(self) source code
 
add_target(self, target)
Adds a target object to the span
source code
 
add_target_id(self, this_id)
Adds a new target to the span with the specified id
source code
 
create_from_ids(self, list_ids)
Adds new targets to the span with the specified ids
source code
 
create_from_targets(self, list_targs)
Adds new targets to the span that are defined in a list
source code
string
get_id_head(self)
Returns the id of the target that is set as "head"
source code
xml Element
get_node(self)
Returns the node of the element
source code
list
get_span_ids(self)
Returns the list of target ids for the span
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 taht returns the target objects

Returns: Ctarget
list of target objects (iterator)

add_target(self, target)

source code 

Adds a target object to the span

Parameters:

add_target_id(self, this_id)

source code 

Adds a new target to the span with the specified id

Parameters:
  • this_id (string) - the id of the new target

create_from_ids(self, list_ids)

source code 

Adds new targets to the span with the specified ids

Parameters:
  • list_ids (list) - list of identifiers

create_from_targets(self, list_targs)

source code 

Adds new targets to the span that are defined in a list

Parameters:
  • list_targs (list) - list of Ctargets

get_id_head(self)

source code 

Returns the id of the target that is set as "head"

Returns: string
the target id (or None) of the head target

get_node(self)

source code 

Returns the node of the element

Returns: xml Element
the node of the element

get_span_ids(self)

source code 

Returns the list of target ids for the span

Returns: list
list of target ids