Module text_data :: Class Cwf
[hide private]
[frames] | no frames]

Class Cwf

source code

This class represents a single token (NAF/KAF wf object)

Instance Methods [hide private]
 
__init__(self, node=None, type='NAF')
Constructor of the object
source code
string
get_id(self)
Returns the token identifier
source code
string
get_length(self)
Returns the length of the token
source code
xml Element
get_node(self)
Returns the node of the element
source code
string
get_offset(self)
Returns the offset of the token
source code
 
get_para(self)
Returns the paragraph for the token
source code
string
get_sent(self)
Returns the sentence of the token
source code
string
get_text(self)
Returns the text of the token
source code
 
set_id(self, this_id)
Set the identifier for the token
source code
 
set_length(self, length)
Set the length for the token
source code
 
set_offset(self, offset)
Set the offset for the token
source code
 
set_para(self, p)
Set the paragraph for the token
source code
 
set_sent(self, this_sent)
Set the sentence for the token
source code
 
set_text(self, this_text)
Set the text for the token
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)

get_id(self)

source code 

Returns the token identifier

Returns: string
the token identifier

get_length(self)

source code 

Returns the length of the token

Returns: string
the length

get_node(self)

source code 

Returns the node of the element

Returns: xml Element
the node of the element

get_offset(self)

source code 

Returns the offset of the token

Returns: string
the offset

get_sent(self)

source code 

Returns the sentence of the token

Returns: string
sentence of the token

get_text(self)

source code 

Returns the text of the token

Returns: string
text of the token

set_id(self, this_id)

source code 

Set the identifier for the token

Parameters:
  • this_id (string) - the identifier

set_length(self, length)

source code 

Set the length for the token

Parameters:
  • length (string) - the length

set_offset(self, offset)

source code 

Set the offset for the token

Parameters:
  • offset (string) - the offset

set_para(self, p)

source code 

Set the paragraph for the token

Parameters:
  • p (string) - the paragraph identifier

set_sent(self, this_sent)

source code 

Set the sentence for the token

Parameters:
  • this_sent (string) - the sentence identifier

set_text(self, this_text)

source code 

Set the text for the token

Parameters:
  • this_text (string) - the text