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

void TaggerWord::add_tag ( TTag &  t,
const wstring &  lf,
vector< wstring > const &  prefer_rules 
) [virtual]

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

Parameters:
tthe coarse tag
lfthe lexical form (fine tag)

Definition at line 103 of file tagger_word.cc.

                                                                                  {

  //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 (match(lf, prefer_rules[i])) 
      {
      lexical_forms[t]=lf;
      break;
      }
    }
  }
}

Generated by  Doxygen 1.6.0   Back to index