FreeLing  3.0
Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | Static Private Attributes
analysis Class Reference

Class analysis stores a possible reading (lemma, PoS, probability, distance) for a word. More...

#include <language.h>

List of all members.

Public Member Functions

 analysis ()
 constructor
 analysis (const std::wstring &, const std::wstring &)
 constructor
analysisoperator= (const analysis &)
 assignment
void set_lemma (const std::wstring &)
 Set lemma for analysis.
void set_tag (const std::wstring &)
 Set PoS tag for analysis.
void set_prob (double)
 Set probability for analysis.
void set_distance (double)
 Set distance for analysis.
void set_retokenizable (const std::list< word > &)
 Set retokenization info for analysis.
bool has_prob () const
 Check whether probability has been set.
bool has_distance () const
 Check whether distance has been set.
std::wstring get_lemma () const
 Get lemma value for analysis.
std::wstring get_tag () const
 Get PoS tag value for analysis.
std::wstring get_short_tag () const
 Get short version of the PoS tag for the analysis, assuming usual EAGLES tagset.
std::wstring get_short_tag (const std::wstring &) const
double get_prob () const
 Get probability value for analysis (-1 if not set).
double get_distance () const
 Get distance value for analysis (-1 if not set).
bool is_retokenizable () const
 Find out if the analysis may imply retokenization.
std::list< wordget_retokenizable () const
 Get retokenization info for analysis.
std::list< std::pair
< std::wstring, double > > 
get_senses () const
 get analysis sense list
void set_senses (const std::list< std::pair< std::wstring, double > > &)
 set analiysis sense list
std::wstring get_senses_string () const
int max_kbest () const
bool is_selected (int k=0) const
 find out whether the analysis is selected in the tagger k-th best sequence
void mark_selected (int k=0)
 mark this analysis as selected in k-th best sequence
void unmark_selected (int k=0)
 unmark this analysis as selected in k-th best sequence
bool operator< (const analysis &) const
 Comparison to sort analysis by *decreasing* probability.
bool operator== (const analysis &) const
 Comparison (to please MSVC)

Public Attributes

std::vector< std::wstring > user
 user-managed data, we just store it.

Private Member Functions

std::wstring shorten_tag (const std::wstring &s=L"V") const
 Get short version of the PoS tag for the analysis, assigning 3 digits to categories listed in "s".

Private Attributes

std::wstring lemma
 lemma
std::wstring tag
 PoS tag.
double prob
 probability of that lemma-tag given the word
double distance
 distance from a added analysis from corrector to the original word
std::list< std::pair
< std::wstring, double > > 
senses
 list of possible senses for that analysis, along with their rank as attributed by the ukb PPR algorithm
std::list< wordretok
 information to retokenize the word after tagging if this analysis is selected
std::set< int > selected_kbest

Static Private Attributes

static std::map< std::wstring,
std::wstring > 
stag_cache
 Class analysis stores a possible reading (lemma, PoS, probability, distance) for a word.

Detailed Description

Class analysis stores a possible reading (lemma, PoS, probability, distance) for a word.


Constructor & Destructor Documentation

constructor

Create empty analysis.

analysis::analysis ( const std::wstring &  ,
const std::wstring &   
)

constructor


Member Function Documentation

double analysis::get_distance ( ) const

Get distance value for analysis (-1 if not set).

wstring analysis::get_lemma ( ) const

Get lemma value for analysis.

double analysis::get_prob ( ) const

Get probability value for analysis (-1 if not set).

Get retokenization info for analysis.

list< pair< wstring, double > > analysis::get_senses ( ) const

get analysis sense list

wstring analysis::get_senses_string ( ) const
wstring analysis::get_short_tag ( ) const

Get short version of the PoS tag for the analysis, assuming usual EAGLES tagset.

Referenced by probabilities::guesser(), and hmm_tagger::hmm_tagger().

std::wstring analysis::get_short_tag ( const std::wstring &  ) const
wstring analysis::get_tag ( ) const

Get PoS tag value for analysis.

Check whether distance has been set.

Check whether probability has been set.

Find out if the analysis may imply retokenization.

bool analysis::is_selected ( int  k = 0) const

find out whether the analysis is selected in the tagger k-th best sequence

void analysis::mark_selected ( int  k = 0)

mark this analysis as selected in k-th best sequence

int analysis::max_kbest ( ) const
bool analysis::operator< ( const analysis a) const

Comparison to sort analysis by *decreasing* probability.

Comparison to sort analysis by *decreasing* probability and ascending alphabetical tag.

References prob, and tag.

analysis & analysis::operator= ( const analysis a)

assignment

Assignment.

References distance, lemma, prob, retok, selected_kbest, senses, tag, and user.

bool analysis::operator== ( const analysis a) const

Comparison (to please MSVC)

comparison (just to please MSVC)

References lemma, and tag.

void analysis::set_distance ( double  d)

Set distance for analysis.

void analysis::set_lemma ( const std::wstring &  )

Set lemma for analysis.

void analysis::set_prob ( double  p)

Set probability for analysis.

Referenced by senses::analyze(), and probabilities::guesser().

void analysis::set_retokenizable ( const std::list< word > &  )

Set retokenization info for analysis.

Referenced by affixes::ApplyRule().

void analysis::set_senses ( const std::list< std::pair< std::wstring, double > > &  )

set analiysis sense list

Referenced by senses::analyze().

void analysis::set_tag ( const std::wstring &  )

Set PoS tag for analysis.

wstring analysis::shorten_tag ( const std::wstring &  s = L"V") const [private]

Get short version of the PoS tag for the analysis, assigning 3 digits to categories listed in "s".

void analysis::unmark_selected ( int  k = 0)

unmark this analysis as selected in k-th best sequence


Member Data Documentation

double analysis::distance [private]

distance from a added analysis from corrector to the original word

Referenced by operator=().

std::wstring analysis::lemma [private]

lemma

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

double analysis::prob [private]

probability of that lemma-tag given the word

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

std::list<word> analysis::retok [private]

information to retokenize the word after tagging if this analysis is selected

Referenced by operator=().

std::set<int> analysis::selected_kbest [private]

Referenced by operator=().

std::list<std::pair<std::wstring,double> > analysis::senses [private]

list of possible senses for that analysis, along with their rank as attributed by the ukb PPR algorithm

Referenced by operator=().

map< wstring, wstring > analysis::stag_cache [static, private]

Class analysis stores a possible reading (lemma, PoS, probability, distance) for a word.

static cache for shortening tags.

std::wstring analysis::tag [private]

PoS tag.

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

std::vector<std::wstring> analysis::user

user-managed data, we just store it.

Referenced by operator=().


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