Package feature_extractor :: Module constituency :: Class Cconstituency_extractor
[hide private]
[frames] | no frames]

Class Cconstituency_extractor

source code

This is the main class that allows the extraction of information

Instance Methods [hide private]
 
__expand_node(self, node, include_this_node=True) source code
 
__init__(self, knaf_obj)
Constructor from a KAfPArser object
source code
 
extract_info_from_naf(self, knaf_obj) source code
list
get_all_chunks_for_term(self, termid)
Returns all the chunks in which the term is contained
source code
 
get_all_deepest_chunks(self) source code
list
get_chunks(self, chunk_type)
Returns the chunks for a certain type
source code
(string,list)
get_deepest_phrase_for_termid(self, termid)
Returns the deepest phrase type for the term identifier and the list of subsumed by the same element
source code
 
get_deepest_phrases(self) source code
 
get_deepest_subsumer(self, list_terms)
Returns the labels of the deepest node that subsumes all the terms in the list of terms id's provided
source code
string
get_least_common_subsumer(self, from_tid, to_tid)
Returns the deepest common subsumer among two terms
source code
list
get_path_for_termid(self, termid)
This function returns the path (in terms of phrase types) from one term the root
source code
list
get_path_from_to(self, from_tid, to_tid)
This function returns the path (in terms of phrase types) from one term to another
source code
Method Details [hide private]

__init__(self, knaf_obj)
(Constructor)

source code 

Constructor from a KAfPArser object

Parameters:
  • knaf_obj (KAfParser) - the KAF/NAF object

get_all_chunks_for_term(self, termid)

source code 

Returns all the chunks in which the term is contained

Parameters:
  • termid (string) - the term identifier
Returns: list
list of chunks

get_chunks(self, chunk_type)

source code 

Returns the chunks for a certain type

Parameters:
  • chunk_type (string) - type of the chunk
Returns: list
the chunks for that type

get_deepest_phrase_for_termid(self, termid)

source code 

Returns the deepest phrase type for the term identifier and the list of subsumed by the same element

Parameters:
  • termid (string) - term identifier
Returns: (string,list)
the label and list of terms subsumed

get_least_common_subsumer(self, from_tid, to_tid)

source code 

Returns the deepest common subsumer among two terms

Parameters:
  • from_tid (string) - one term id
  • to_tid (string) - another term id
Returns: string
the term identifier of the common subsumer

get_path_for_termid(self, termid)

source code 

This function returns the path (in terms of phrase types) from one term the root

Parameters:
  • termid (string) - one term id
Returns: list
the path, list of phrase types

get_path_from_to(self, from_tid, to_tid)

source code 

This function returns the path (in terms of phrase types) from one term to another

Parameters:
  • from_tid (string) - one term id
  • to_tid (string) - another term id
Returns: list
the path, list of phrase types