Module term_data :: Class Cterm
[hide private]
[frames] | no frames]

Class Cterm

source code

This class encapsulates a <term> NAF or KAF object

Instance Methods [hide private]
 
__init__(self, node=None, type='NAF')
Constructor of the object
source code
 
add_external_reference(self, ext_ref)
Adds an external reference object to the term
source code
 
add_term_sentiment(self, term_sentiment)
Adds a sentiment object to the term
source code
CexternalReference
get_external_references(self)
Iterator that returns all the external references of the term
source code
string
get_id(self)
Returns the term identifier
source code
string
get_lemma(self)
Returns the lemma of the object
source code
string
get_morphofeat(self)
Returns the morphofeat attribute of the term
source code
xml Element
get_node(self)
Returns the node of the element
source code
string
get_pos(self)
Returns the part-of-speech of the object
source code
Cterm_sentiment
get_sentiment(self)
Returns the sentiment object of the term
source code
Cspan
get_span(self)
Returns the span object of the term
source code
 
remove_external_references(self)
Removes any external reference from the term
source code
 
set_id(self, i)
Sets the identifier for the term
source code
 
set_lemma(self, l)
Sets the lemma for the term
source code
 
set_morphofeat(self, m)
Sets the morphofeat attribute
source code
 
set_pos(self, p)
Sets the postag for the term
source code
 
set_span(self, this_span)
Sets the span for the lemma
source code
 
set_type(self, t)
Sets the type for the lemma
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_external_reference(self, ext_ref)

source code 

Adds an external reference object to the term

Parameters:

add_term_sentiment(self, term_sentiment)

source code 

Adds a sentiment object to the term

Parameters:

get_external_references(self)

source code 

Iterator that returns all the external references of the term

Returns: CexternalReference
the external references

get_id(self)

source code 

Returns the term identifier

Returns: string
the term identifier

get_lemma(self)

source code 

Returns the lemma of the object

Returns: string
the term lemma

get_morphofeat(self)

source code 

Returns the morphofeat attribute of the term

Returns: string
the term morphofeat feature

get_node(self)

source code 

Returns the node of the element

Returns: xml Element
the node of the element

get_pos(self)

source code 

Returns the part-of-speech of the object

Returns: string
the term pos-tag

get_sentiment(self)

source code 

Returns the sentiment object of the term

Returns: Cterm_sentiment
the term sentiment

get_span(self)

source code 

Returns the span object of the term

Returns: Cspan
the term span

set_id(self, i)

source code 

Sets the identifier for the term

Parameters:
  • i (string) - lemma identifier

set_lemma(self, l)

source code 

Sets the lemma for the term

Parameters:
  • l (string) - lemma

set_morphofeat(self, m)

source code 

Sets the morphofeat attribute

Parameters:
  • m (string) - the morphofeat value

set_pos(self, p)

source code 

Sets the postag for the term

Parameters:
  • p (string) - pos-tag

set_span(self, this_span)

source code 

Sets the span for the lemma

Parameters:
  • this_span (Cspan) - lemma identifier

set_type(self, t)

source code 

Sets the type for the lemma

Parameters:
  • t (string) - type for the term