FreeLing  3.0
Public Member Functions | Private Member Functions | Private Attributes
affixes Class Reference

Class suffixes implements suffixation rules and dictionary search for suffixed word forms. More...

#include <suffixes.h>

Collaboration diagram for affixes:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 affixes (const std::wstring &, const std::wstring &)
 Constructor.
void look_for_affixes (word &, dictionary &)
 look up possible roots of a suffixed/prefixed form

Private Member Functions

void look_for_affixes_in_list (int, std::multimap< std::wstring, sufrule > &, word &, dictionary &) const
 find all applicable affix rules for a word
void look_for_combined_affixes (std::multimap< std::wstring, sufrule > &, std::multimap< std::wstring, sufrule > &, word &, dictionary &) const
 find all applicable prefix+sufix rules combination for a word
std::set< std::wstring > GenerateRoots (int, const sufrule &, const std::wstring &) const
 generate roots according to rules.
void SearchRootsList (std::set< std::wstring > &, const std::wstring &, sufrule &, word &, dictionary &) const
 find roots in dictionary and apply matching rules
void ApplyRule (const std::wstring &, const std::list< analysis > &, const std::wstring &, sufrule &, word &, dictionary &) const
 actually apply a affix rule
void CheckRetokenizable (const sufrule &, const std::wstring &, const std::wstring &, const std::wstring &, dictionary &, std::list< word > &, int) const
 auxiliary method to deal with retokenization

Private Attributes

accents accen
 Language-specific accent handler.
std::multimap< std::wstring,
sufrule
affix [2]
 all suffixation/prefixation rules
std::multimap< std::wstring,
sufrule
affix_always [2]
 suffixation/prefixation rules applied unconditionally
std::set< unsigned int > ExistingLength [2]
 index of existing suffix/prefixs lengths.
unsigned int Longest [2]
 Length of longest suffix/prefix.

Detailed Description

Class suffixes implements suffixation rules and dictionary search for suffixed word forms.


Constructor & Destructor Documentation

affixes::affixes ( const std::wstring &  Lang,
const std::wstring &  sufFile 
)

Member Function Documentation

void affixes::ApplyRule ( const std::wstring &  ,
const std::list< analysis > &  ,
const std::wstring &  ,
sufrule ,
word ,
dictionary  
) const [private]
void affixes::CheckRetokenizable ( const sufrule suf,
const std::wstring &  form,
const std::wstring &  lem,
const std::wstring &  tag,
dictionary dic,
std::list< word > &  rtk,
int  caps 
) const [private]

auxiliary method to deal with retokenization

Check whether the suffix carries retokenization information, and create alternative word list if necessary.

References word::add_analysis(), util::capitalize(), word::get_form(), word::get_lemma(), word::get_tag(), sufrule::retok, dictionary::search_form(), word::set_form(), TRACE, and util::wstring2list().

Referenced by ApplyRule().

set< wstring > affixes::GenerateRoots ( int  kind,
const sufrule suf,
const std::wstring &  rt 
) const [private]

generate roots according to rules.

Generate all possible forms expanding root rt with all possible terminations according to the given suffix rule.

References PREF, SUF, sufrule::term, and TRACE.

Referenced by look_for_affixes_in_list(), and look_for_combined_affixes().

void affixes::look_for_affixes ( word w,
dictionary dic 
)

look up possible roots of a suffixed/prefixed form

Look up possible roots of a suffixed form.

Words already analyzed are only applied the "always"-marked suffix rules. So-far unrecognized words, are applied all the sufix rules.

References affix, affix_always, word::get_form(), word::get_n_analysis(), util::int2wstring(), look_for_affixes_in_list(), look_for_combined_affixes(), PREF, SUF, and TRACE.

void affixes::look_for_affixes_in_list ( int  kind,
std::multimap< std::wstring, sufrule > &  suff,
word w,
dictionary dic 
) const [private]
void affixes::look_for_combined_affixes ( std::multimap< std::wstring, sufrule > &  suff,
std::multimap< std::wstring, sufrule > &  pref,
word w,
dictionary dic 
) const [private]
void affixes::SearchRootsList ( std::set< std::wstring > &  ,
const std::wstring &  ,
sufrule ,
word ,
dictionary  
) const [private]

find roots in dictionary and apply matching rules

Search candidate forms in dictionary, discarding invalid forms and annotating the valid ones.

References ApplyRule(), util::int2wstring(), dictionary::search_form(), and TRACE.

Referenced by look_for_affixes_in_list(), and look_for_combined_affixes().


Member Data Documentation

Language-specific accent handler.

Referenced by look_for_affixes_in_list(), and look_for_combined_affixes().

std::multimap<std::wstring,sufrule> affixes::affix[2] [private]

all suffixation/prefixation rules

Referenced by affixes(), and look_for_affixes().

std::multimap<std::wstring,sufrule> affixes::affix_always[2] [private]

suffixation/prefixation rules applied unconditionally

Referenced by affixes(), and look_for_affixes().

std::set<unsigned int> affixes::ExistingLength[2] [private]

index of existing suffix/prefixs lengths.

Referenced by affixes(), look_for_affixes_in_list(), and look_for_combined_affixes().

unsigned int affixes::Longest[2] [private]

Length of longest suffix/prefix.

Referenced by affixes(), look_for_affixes_in_list(), and look_for_combined_affixes().


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