Module features_data :: Class Cfeatures
[hide private]
[frames] | no frames]

Class Cfeatures

source code

This class encapsulates the features layer in KAF/NAF

Instance Methods [hide private]
 
__init__(self, node=None, type='NAF')
Constructor of the object
source code
 
add_property(self, pid, label, term_span)
Adds a new property to the property layer
source code
xml Element
get_node(self)
Returns the node of the element
source code
Cproperty
get_properties(self)
Iterator that returns all the properties of the layuer
source code
 
remove_properties(self)
Removes the property layer, if exists
source code
 
to_kaf(self)
Converts the element to NAF
source code
 
to_naf(self)
Converts the element to KAF
source code
Method Details [hide private]

__init__(self, node=None, type='NAF')
(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
  • type (string) - the type of the object (KAF or NAF)

add_property(self, pid, label, term_span)

source code 

Adds a new property to the property layer

Parameters:
  • pid (string) - property identifier
  • label (string) - the label of the property
  • term_span (list) - list of term identifiers

get_node(self)

source code 

Returns the node of the element

Returns: xml Element
the node of the element

get_properties(self)

source code 

Iterator that returns all the properties of the layuer

Returns: Cproperty
list of property objects (iterator)