Logo Search packages:      
Sourcecode: apertium version File versions  Download package

void TaggerWord::add_tag ( TTag &  t,
const string &  lf,
vector< string > const &  prefer_rules 
)

Add a new tag to the set of all possible tags of the word.

Parameters:
t the coarse tag
lf the lexical form (fine tag)

Definition at line 53 of file TaggerWord.C.

                                                                                {
  //Tag is added only is it is not present yet
  //Sometime one word can have more than one lexical form assigned to the same tag
  if (tags.find(t)==tags.end()) {
     tags.insert(t);
     lexical_forms[t]=lf;
  } else {
     //Take a look at the prefer rulesÁ
     for(int i=0; i < (int) prefer_rules.size(); i++) {
        if (lf.find(prefer_rules[i])<lf.size()) {
         lexical_forms[t]=lf;
         break;
      }
     }
  }
}


Generated by  Doxygen 1.6.0   Back to index