FreeLing  4.0
Public Types | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
freeling::mention Class Reference

Class mention is a node in the parse tree, as well as the sequence of tokens subsumed by the node. More...

#include <language.h>

Collaboration diagram for freeling::mention:
Collaboration graph
[legend]

List of all members.

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.
mentionoperator= (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 wordget_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

Detailed Description

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)


Member Enumeration Documentation

Enumerator:
PROPER_NOUN 
PRONOUN 
NOUN_PHRASE 
COMPOSITE 
VERB_PHRASE 
Enumerator:
PER 
MALE 
FEMALE 
NOTPER 
ORG 
GEO 
TIME 
DATE 
MONEY 
OTHER 

Constructor & Destructor Documentation

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.

Copy constructor.

References clone().


Member Function Documentation

void freeling::mention::clone ( const mention m) [private]

private functions

Clone mention.

clone a mention

References chain, id, initial, itBegin, itEnd, itHead, mType, posBegin, posEnd, ptree, s, sent, and single_subsumtion.

Referenced by mention(), and operator=().

References chain.

Referenced by freeling::document::add_mention().

const word & freeling::mention::get_head ( ) const

References itHead.

getters

References id.

Referenced by freeling::document::add_mention().

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.

References sent.

References posBegin.

References posEnd.

References ptree.

paragraph::const_iterator freeling::mention::get_sentence ( ) const

References s.

References mType.

References initial.

References single_subsumtion.

References mType.

bool freeling::mention::operator< ( const mention m) const

True when the mention starts before m in the document.

References posBegin, and posEnd.

mention & freeling::mention::operator= ( const mention m)

assignment

Assignment.

References clone().

References chain.

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

get string of mention words, lowercasing the first "lc" (none by default)

References itBegin, and itEnd.


Member Data Documentation

the coreference chain to which the mention belongs

Referenced by clone(), get_group(), mention(), and set_group().

the id of the mention

Referenced by clone(), get_id(), and set_id().

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().

the type of the mention

Referenced by clone(), get_type(), is_type(), and set_type().

the starting position within the sentence

Referenced by clone(), get_pos_begin(), mention(), and operator<().

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().

the number of sentence in which the mention occurs

Referenced by clone(), get_n_sentence(), and mention().

subsumed by another mention in which any verb occurs?

Referenced by clone(), is_subsumed_with_no_verb(), mention(), and subsumed_with_no_verb().


The documentation for this class was generated from the following files: