FreeLing
4.0
|
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::map< std::wstring, std::wstring > | get_msd_features_map (const std::wstring &tag) const |
get map of <feature,value> pairs with morphological information | |
std::list< std::pair < std::wstring, std::wstring > > | get_msd_features (const std::wstring &tag) const |
get list of <feature,value> pairs with morphological information | |
std::wstring | get_msd_string (const std::wstring &tag) const |
get list <feature,value> pairs with morphological information, in a string format | |
std::wstring | msd_to_tag (const std::wstring &cat, const std::list< std::pair< std::wstring, std::wstring > > &msd) const |
get EAGLES tag from morphological info given as list <feature,value> pairs | |
std::wstring | msd_to_tag (const std::wstring &cat, const std::wstring &msd) const |
get EAGLES tag from morphological info given as string | |
Private Member Functions | |
std::list< std::pair < std::wstring, std::wstring > > | compute_msd_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::wstring > | name |
std::map< std::wstring, std::wstring > | name_inv |
std::map< std::wstring, std::wstring > | val_inv |
std::map< std::wstring, std::pair< std::wstring, std::wstring > > | direct |
short tag+mfs for direct entry rules | |
std::map< std::set < std::wstring >, std::wstring > | direct_inv |
std::map< std::wstring, std::list< 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, direct_inv, ERROR_CRASH, feat, freeling::config_file::get_content_line(), freeling::config_file::get_section(), int2wstring, MSD_SEP, name, name_inv, freeling::config_file::open(), shtag_size, TRACE, freeling::util::uppercase(), val, val_inv, freeling::util::wstring2int(), wstring2list, wstring2set, and wstring2vector.
destructor
--- destructor
list< pair< wstring, wstring > > freeling::tagset::compute_msd_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, name, TRACE, freeling::util::uppercase(), val, and WARNING.
Referenced by get_msd_features(), and get_msd_string().
list< pair< wstring, wstring > > freeling::tagset::get_msd_features | ( | const std::wstring & | tag | ) | const |
get list of <feature,value> pairs with morphological information
References compute_msd_features(), direct, MSD_SEP, PAIR_SEP, TRACE, and freeling::util::wstring2pairlist().
Referenced by get_msd_features_map().
map< wstring, wstring > freeling::tagset::get_msd_features_map | ( | const std::wstring & | tag | ) | const |
get map of <feature,value> pairs with morphological information
References get_msd_features().
wstring freeling::tagset::get_msd_string | ( | const std::wstring & | tag | ) | const |
get list <feature,value> pairs with morphological information, in a string format
References compute_msd_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::locutions::ComputeToken(), 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::wstring freeling::tagset::msd_to_tag | ( | const std::wstring & | cat, |
const std::list< std::pair< std::wstring, std::wstring > > & | msd | ||
) | const |
get EAGLES tag from morphological info given as list <feature,value> pairs
std::wstring freeling::tagset::msd_to_tag | ( | const std::wstring & | cat, |
const std::wstring & | msd | ||
) | const |
get EAGLES tag from morphological info given as string
std::map<std::wstring,std::pair<std::wstring,std::wstring> > freeling::tagset::direct [private] |
short tag+mfs for direct entry rules
Referenced by get_msd_features(), get_msd_string(), get_short_tag(), and tagset().
std::map<std::set<std::wstring>,std::wstring> freeling::tagset::direct_inv [private] |
Referenced by tagset().
std::map<std::wstring,std::wstring> freeling::tagset::feat [private] |
maps to store PoS tags translation rules and features.
Referenced by compute_msd_features(), and tagset().
const std::wstring freeling::tagset::MSD_SEP [private] |
Referenced by get_msd_features(), get_msd_string(), and tagset().
std::map<std::wstring,std::wstring> freeling::tagset::name [private] |
Referenced by compute_msd_features(), and tagset().
std::map<std::wstring,std::wstring> freeling::tagset::name_inv [private] |
Referenced by tagset().
const std::wstring freeling::tagset::PAIR_SEP [private] |
Referenced by get_msd_features(), and get_msd_string().
std::map<std::wstring,std::list<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_msd_features(), and tagset().
std::map<std::wstring,std::wstring> freeling::tagset::val_inv [private] |
Referenced by tagset().