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

string TaggerWord::get_lexical_form ( TTag &  t,
int const   TAG_kEOF 
)

Get the lexical form (fine tag) for a given tag (coarse one)

Parameters:
t the tag
Returns:
the lexical form of tag t

Definition at line 93 of file TaggerWord.C.

Referenced by HMM::evaltagger().

                                                        {
  string ret="";

  if (show_ingnored_string)
    ret+=ignored_string;
   
  if(t==TAG_kEOF)
    return ret;

  if (!previous_plus_cut)
    ret+="^"; 

  if (lexical_forms.size()==0) { // This is an UNKNOWN WORD
    ret +="*"+superficial_form;
  } else if ((*lexical_forms.begin()).second[0]=='*') { //This is an
                                          //unknown word
                                          //that has
                                          //been guessed
    ret += "*"+superficial_form;
  } else if (lexical_forms.size()>1) {  //This is an ambiguous word
    ret +=lexical_forms[t];
  } else {
    ret +=lexical_forms[t];
  }
  
  if (ret != ignored_string) {
    if (plus_cut)
      ret+="+";
    else {
      ret +="$";  
    }
  }


  //if ((superficial_form.length()>0)&&(superficial_form[superficial_form.length()-1]=='\''))
  //   //Si la forma superficial termina en apostrofo metemos un espacio en blanco tras la cadena '/$'
  //   //o '/'. De no hacerlo en la traducción aparecerán dos palabras sin blanco alguno.
  //   ret+=" "; //Quizá este no sea el sitio apropiado para hacer esto, lo suyo sería un módulo
  //             //antes del tagger o del anmor.
     
  return ret;
}


Generated by  Doxygen 1.6.0   Back to index