FreeLing
4.0
|
Class mention is a node in the parse tree, as well as the sequence of tokens subsumed by the node. More...
#include <language.h>
Public Types | |
enum | mentionType { PROPER_NOUN, PRONOUN, NOUN_PHRASE, COMPOSITE, VERB_PHRASE } |
enum | SEMmentionType { PER, MALE, FEMALE, NOTPER, ORG, GEO, TIME, DATE, MONEY, OTHER } |
Public Member Functions | |
mention (int, int, paragraph::const_iterator, parse_tree::const_iterator, int, sentence::const_iterator) | |
constructor from a parse_tree | |
mention (int, int, paragraph::const_iterator, sentence::const_iterator, sentence::const_iterator) | |
constructor from start/end word iterators | |
mention (const mention &) | |
Copy constructor. | |
mention & | operator= (const mention &) |
assignment | |
bool | operator< (const mention &m) const |
True when the mention starts before m in the document. | |
void | set_id (int) |
setters | |
void | set_type (mentionType) |
void | set_initial (bool) |
void | set_group (int) |
void | subsumed_with_no_verb (bool b=false) |
int | get_id () const |
getters | |
int | get_n_sentence () const |
paragraph::const_iterator | get_sentence () const |
int | get_pos_begin () const |
int | get_pos_end () const |
sentence::const_iterator | get_it_begin () const |
sentence::const_iterator | get_it_end () const |
sentence::const_iterator | get_it_head () const |
mentionType | get_type () const |
int | get_group () const |
bool | is_type (mentionType) const |
bool | is_initial () const |
bool | is_subsumed_with_no_verb () const |
parse_tree::const_iterator | get_ptree () const |
const word & | get_head () const |
std::wstring | value (int lc=0) const |
get string of mention words, lowercasing the first "lc" (none by default) | |
Private Member Functions | |
void | clone (const mention &) |
private functions | |
Static Private Member Functions | |
static void | set_tokens (parse_tree::const_iterator, int &, sentence::const_iterator &) |
recursively fills tokens and tags; last parameters return posEnd+1 and itEnd+1; | |
static void | set_iterators (sentence::const_iterator, sentence::const_iterator, const parse_tree &, sentence::const_iterator &, parse_tree::const_iterator &) |
obtain the node that maximize the subsumtion of the sequence defined by the first and second iterators third parameter is the root last two parameters return the iterator of the last word within the subsumtion and the tree node subsuming the sequence | |
Private Attributes | |
int | id |
the id of the mention | |
mentionType | mType |
the type of the mention | |
int | sent |
the number of sentence in which the mention occurs | |
paragraph::const_iterator | s |
the sentence of the mention | |
bool | initial |
is the first mention in the sentence? | |
bool | single_subsumtion |
subsumed by another mention in which any verb occurs? | |
parse_tree::const_iterator | ptree |
the node_tree of the mention | |
int | posBegin |
the starting position within the sentence | |
int | posEnd |
the ending position | |
sentence::const_iterator | itBegin |
the starting iterator within the sentence | |
sentence::const_iterator | itEnd |
the ending iterator | |
sentence::const_iterator | itHead |
the head iterator | |
int | chain |
the coreference chain to which the mention belongs |
Class mention is a node in the parse tree, as well as the sequence of tokens subsumed by the node.
(It is assumed that a depnode corresponds to a parse tree node)
freeling::mention::mention | ( | int | , |
int | , | ||
paragraph::const_iterator | , | ||
parse_tree::const_iterator | , | ||
int | , | ||
sentence::const_iterator | |||
) |
constructor from a parse_tree
freeling::mention::mention | ( | int | i, |
int | ns, | ||
paragraph::const_iterator | ps, | ||
sentence::const_iterator | start_it, | ||
sentence::const_iterator | end_it | ||
) |
constructor from start/end word iterators
fuzzy constructor from start/end positions the mention is created from start1 to end1 (start1 >= start and end1 <= end) [start1, end1] is the sequence closest to start with the maximal subsuming node ptree
References chain, freeling::parse_tree::get_head_word(), freeling::tree< node >::get_leftmost_leaf(), freeling::basic_tree_iterator< T, N >::get_parent(), freeling::tree< node >::get_rightmost_leaf(), initial, freeling::basic_tree_iterator< T, N >::is_root(), itBegin, itEnd, itHead, posBegin, posEnd, ptree, s, sent, and single_subsumtion.
freeling::mention::mention | ( | const mention & | m | ) |
Copy constructor.
References clone().
void freeling::mention::clone | ( | const mention & | m | ) | [private] |
int freeling::mention::get_group | ( | ) | const |
References chain.
Referenced by freeling::document::add_mention().
const word & freeling::mention::get_head | ( | ) | const |
References itHead.
int freeling::mention::get_id | ( | ) | const |
sentence::const_iterator freeling::mention::get_it_begin | ( | ) | const |
References itBegin.
sentence::const_iterator freeling::mention::get_it_end | ( | ) | const |
References itEnd.
sentence::const_iterator freeling::mention::get_it_head | ( | ) | const |
References itHead.
int freeling::mention::get_n_sentence | ( | ) | const |
References sent.
int freeling::mention::get_pos_begin | ( | ) | const |
References posBegin.
int freeling::mention::get_pos_end | ( | ) | const |
References posEnd.
References ptree.
paragraph::const_iterator freeling::mention::get_sentence | ( | ) | const |
References s.
References mType.
bool freeling::mention::is_initial | ( | ) | const |
References initial.
bool freeling::mention::is_subsumed_with_no_verb | ( | ) | const |
References single_subsumtion.
bool freeling::mention::is_type | ( | mention::mentionType | t | ) | const |
References mType.
bool freeling::mention::operator< | ( | const mention & | m | ) | const |
void freeling::mention::set_group | ( | int | g | ) |
References chain.
void freeling::mention::set_id | ( | int | id | ) |
setters
References id.
void freeling::mention::set_initial | ( | bool | val | ) |
References initial.
void freeling::mention::set_iterators | ( | sentence::const_iterator | , |
sentence::const_iterator | , | ||
const parse_tree & | , | ||
sentence::const_iterator & | , | ||
parse_tree::const_iterator & | |||
) | [static, private] |
obtain the node that maximize the subsumtion of the sequence defined by the first and second iterators third parameter is the root last two parameters return the iterator of the last word within the subsumtion and the tree node subsuming the sequence
obtain the node that maximize the subsumtion of the sequence defined by the first and second iterators last parameters return the iterator of the last word within the subsumtion and the tree node subsuming the sequence
References freeling::basic_tree_iterator< T, N >::get_parent(), freeling::tree< node >::get_rightmost_leaf(), freeling::basic_tree_iterator< T, N >::is_root(), and freeling::basic_tree_iterator< T, N >::sibling_begin().
void freeling::mention::set_tokens | ( | parse_tree::const_iterator | , |
int & | , | ||
sentence::const_iterator & | |||
) | [static, private] |
recursively fills tokens and tags; last parameters return posEnd+1 and itEnd+1;
fills tokens and tags from parse_tree pt and wordn last parameters return posEnd+1 and itEnd+1;
References freeling::basic_tree_iterator< T, N >::num_children(), freeling::basic_tree_iterator< T, N >::sibling_begin(), and freeling::basic_tree_iterator< T, N >::sibling_end().
References mType.
void freeling::mention::subsumed_with_no_verb | ( | bool | b = false | ) |
References single_subsumtion.
wstring freeling::mention::value | ( | int | lc = 0 | ) | const |
int freeling::mention::chain [private] |
the coreference chain to which the mention belongs
Referenced by clone(), get_group(), mention(), and set_group().
int freeling::mention::id [private] |
bool freeling::mention::initial [private] |
is the first mention in the sentence?
Referenced by clone(), is_initial(), mention(), and set_initial().
sentence::const_iterator freeling::mention::itBegin [private] |
the starting iterator within the sentence
Referenced by clone(), get_it_begin(), mention(), and value().
sentence::const_iterator freeling::mention::itEnd [private] |
the ending iterator
Referenced by clone(), get_it_end(), mention(), and value().
sentence::const_iterator freeling::mention::itHead [private] |
the head iterator
Referenced by clone(), get_head(), get_it_head(), and mention().
mentionType freeling::mention::mType [private] |
the type of the mention
Referenced by clone(), get_type(), is_type(), and set_type().
int freeling::mention::posBegin [private] |
the starting position within the sentence
Referenced by clone(), get_pos_begin(), mention(), and operator<().
int freeling::mention::posEnd [private] |
the ending position
Referenced by clone(), get_pos_end(), mention(), and operator<().
the node_tree of the mention
Referenced by clone(), get_ptree(), and mention().
paragraph::const_iterator freeling::mention::s [private] |
the sentence of the mention
Referenced by clone(), get_sentence(), and mention().
int freeling::mention::sent [private] |
the number of sentence in which the mention occurs
Referenced by clone(), get_n_sentence(), and mention().
bool freeling::mention::single_subsumtion [private] |
subsumed by another mention in which any verb occurs?
Referenced by clone(), is_subsumed_with_no_verb(), mention(), and subsumed_with_no_verb().