FreeLing
3.1
|
The class tagset handles PoS tags long to short conversion and morphosintactic feature decomposition. More...
#include <tagset.h>
Public Member Functions | |
tagset (const std::wstring &f) | |
constructor: load a map file | |
~tagset () | |
destructor | |
std::wstring | get_short_tag (const std::wstring &tag) const |
get short version of given tag | |
std::list< std::pair < std::wstring, std::wstring > > | get_msf_features (const std::wstring &tag) const |
get list of <feature,value> pairs with morphological information | |
std::wstring | get_msf_string (const std::wstring &tag) const |
get list <feature,value> pairs with morphological information, in a string format | |
Private Member Functions | |
std::list< std::pair < std::wstring, std::wstring > > | compute_msf_features (const std::wstring &tag) const |
decompose a tag in morphological features | |
Private Attributes | |
const std::wstring | PAIR_SEP |
const std::wstring | MSD_SEP |
std::map< std::wstring, std::wstring > | feat |
maps to store PoS tags translation rules and features. | |
std::map< std::wstring, std::wstring > | val |
std::map< std::wstring, std::pair< std::wstring, std::wstring > > | direct |
short tag+mfs for direct entry rules | |
std::map< std::wstring, int > | shtag_size |
size for short version of the tag |
The class tagset handles PoS tags long to short conversion and morphosintactic feature decomposition.
freeling::tagset::tagset | ( | const std::wstring & | f | ) |
constructor: load a map file
--- constructor: load given file
References freeling::config_file::add_section(), freeling::config_file::close(), direct, ERROR_CRASH, feat, freeling::config_file::get_content_line(), freeling::config_file::get_section(), int2wstring, freeling::config_file::open(), shtag_size, TRACE, val, and wstring2vector.
destructor
--- destructor
list< pair< wstring, wstring > > freeling::tagset::compute_msf_features | ( | const std::wstring & | tag | ) | const [private] |
decompose a tag in morphological features
private method to decompose the tag into morphological features interpreting each digit in the tag according to field definition.
feat[<cat,i>] is the feature name (e.g. "postype") val[<cat,i>] is a map<code,name> with the feature values
References feat, int2wstring, TRACE, val, and WARNING.
Referenced by get_msf_features(), and get_msf_string().
list< pair< wstring, wstring > > freeling::tagset::get_msf_features | ( | const std::wstring & | tag | ) | const |
get list of <feature,value> pairs with morphological information
References compute_msf_features(), direct, MSD_SEP, PAIR_SEP, TRACE, and freeling::util::wstring2pairlist().
wstring freeling::tagset::get_msf_string | ( | const std::wstring & | tag | ) | const |
get list <feature,value> pairs with morphological information, in a string format
References compute_msf_features(), direct, MSD_SEP, PAIR_SEP, freeling::util::pairlist2wstring(), and TRACE.
wstring freeling::tagset::get_short_tag | ( | const std::wstring & | tag | ) | const |
get short version of given tag
References direct, int2wstring, shtag_size, TRACE, and WARNING.
Referenced by freeling::hmm_tagger::annotate(), freeling::hmm_tagger::FindStates(), freeling::probabilities::guesser(), freeling::hmm_tagger::hmm_tagger(), freeling::hmm_tagger::is_forbidden(), freeling::hmm_tagger::ProbB_log(), freeling::hmm_tagger::SequenceProb_log(), and freeling::probabilities::smoothing().
std::map<std::wstring,std::pair<std::wstring,std::wstring> > freeling::tagset::direct [private] |
short tag+mfs for direct entry rules
Referenced by get_msf_features(), get_msf_string(), get_short_tag(), and tagset().
std::map<std::wstring,std::wstring> freeling::tagset::feat [private] |
maps to store PoS tags translation rules and features.
Referenced by compute_msf_features(), and tagset().
const std::wstring freeling::tagset::MSD_SEP [private] |
Referenced by get_msf_features(), and get_msf_string().
const std::wstring freeling::tagset::PAIR_SEP [private] |
Referenced by get_msf_features(), and get_msf_string().
std::map<std::wstring,int> freeling::tagset::shtag_size [private] |
size for short version of the tag
Referenced by get_short_tag(), and tagset().
std::map<std::wstring,std::wstring> freeling::tagset::val [private] |
Referenced by compute_msf_features(), and tagset().