FreeLing
4.0
|
Class analysis stores a possible reading (lemma, PoS, probability, distance) for a word. More...
#include <language.h>
Public Member Functions | |
analysis () | |
constructor | |
analysis (const std::wstring &, const std::wstring &) | |
constructor | |
analysis & | operator= (const analysis &) |
assignment | |
void | init (const std::wstring &l, const std::wstring &t) |
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. | |
const std::wstring & | get_lemma () const |
Get lemma value for analysis. | |
const std::wstring & | get_tag () const |
Get PoS tag value for analysis. | |
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< word > & | get_retokenizable () |
Get retokenization info for analysis. | |
const std::list< word > & | get_retokenizable () const |
Get retokenization info for analysis. | |
const std::list< std::pair < std::wstring, double > > & | get_senses () const |
get analysis sense list | |
std::list< std::pair < std::wstring, double > > & | get_senses () |
get ref to 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 sort analysis by *increasing* 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 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< word > | retok |
information to retokenize the word after tagging if this analysis is selected | |
std::set< int > | selected_kbest |
Class analysis stores a possible reading (lemma, PoS, probability, distance) for a word.
constructor
Class analysis stores a possible reading (lemma, PoS, probability, distance) for a word.
Create empty analysis
freeling::analysis::analysis | ( | const std::wstring & | , |
const std::wstring & | |||
) |
constructor
double freeling::analysis::get_distance | ( | ) | const |
Get distance value for analysis (-1 if not set).
const wstring & freeling::analysis::get_lemma | ( | ) | const |
Get lemma value for analysis.
Referenced by freeling::dictionary::add_analysis(), and freeling::probabilities::less().
double freeling::analysis::get_prob | ( | ) | const |
Get probability value for analysis (-1 if not set).
Referenced by freeling::probabilities::less().
Get retokenization info for analysis.
const list< word > & freeling::analysis::get_retokenizable | ( | ) | const |
Get retokenization info for analysis.
const list< pair< wstring, double > > & freeling::analysis::get_senses | ( | ) | const |
get analysis sense list
list< pair< wstring, double > > & freeling::analysis::get_senses | ( | ) |
get ref to analysis sense list
wstring freeling::analysis::get_senses_string | ( | ) | const |
const wstring & freeling::analysis::get_tag | ( | ) | const |
Get PoS tag value for analysis.
Referenced by freeling::dictionary::add_analysis(), and freeling::probabilities::less().
bool freeling::analysis::has_distance | ( | ) | const |
Check whether distance has been set.
bool freeling::analysis::has_prob | ( | ) | const |
Check whether probability has been set.
void freeling::analysis::init | ( | const std::wstring & | l, |
const std::wstring & | t | ||
) |
bool freeling::analysis::is_retokenizable | ( | ) | const |
Find out if the analysis may imply retokenization.
bool freeling::analysis::is_selected | ( | int | k = 0 | ) | const |
find out whether the analysis is selected in the tagger k-th best sequence
void freeling::analysis::mark_selected | ( | int | k = 0 | ) |
mark this analysis as selected in k-th best sequence
int freeling::analysis::max_kbest | ( | ) | const |
bool freeling::analysis::operator< | ( | const analysis & | a | ) | const |
bool freeling::analysis::operator== | ( | const analysis & | a | ) | const |
bool freeling::analysis::operator> | ( | const analysis & | a | ) | const |
void freeling::analysis::set_distance | ( | double | d | ) |
Set distance for analysis.
void freeling::analysis::set_lemma | ( | const std::wstring & | ) |
Set lemma for analysis.
void freeling::analysis::set_prob | ( | double | p | ) |
Set probability for analysis.
Referenced by freeling::senses::analyze(), and freeling::probabilities::guesser().
void freeling::analysis::set_retokenizable | ( | const std::list< word > & | ) |
Set retokenization info for analysis.
Referenced by freeling::affixes::ApplyRule().
void freeling::analysis::set_senses | ( | const std::list< std::pair< std::wstring, double > > & | ) |
set analiysis sense list
Referenced by freeling::senses::analyze().
void freeling::analysis::set_tag | ( | const std::wstring & | ) |
Set PoS tag for analysis.
void freeling::analysis::unmark_selected | ( | int | k = 0 | ) |
unmark this analysis as selected in k-th best sequence
double freeling::analysis::distance [private] |
distance from a added analysis from corrector to the original word
Referenced by operator=().
std::wstring freeling::analysis::lemma [private] |
lemma
Referenced by operator=(), and operator==().
double freeling::analysis::prob [private] |
probability of that lemma-tag given the word
Referenced by operator<(), operator=(), and operator>().
std::list<word> freeling::analysis::retok [private] |
information to retokenize the word after tagging if this analysis is selected
Referenced by operator=().
std::set<int> freeling::analysis::selected_kbest [private] |
Referenced by operator=().
std::list<std::pair<std::wstring,double> > freeling::analysis::senses [private] |
list of possible senses for that analysis, along with their rank as attributed by the ukb PPR algorithm
Referenced by operator=().
std::wstring freeling::analysis::tag [private] |
PoS tag.
Referenced by operator<(), operator=(), operator==(), and operator>().
std::vector<std::wstring> freeling::analysis::user |
user-managed data, we just store it.
Referenced by operator=().