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

wstring TaggerWord::get_lexical_form ( TTag &  t,
int const   TAG_kEOF 
) [virtual]

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 151 of file tagger_word.cc.

                                                        {
  wstring ret= L"";

  if (show_ingnored_string)
    ret.append(ignored_string);
   
  if(t==TAG_kEOF)
    return ret;

  if (!previous_plus_cut){
    if(TaggerWord::generate_marks && isAmbiguous())
    {
      ret.append(L"^=");
    }
    else
    {
      ret += L'^';
    }

    if(get_show_sf()){   // append the superficial form
      ret.append(superficial_form);
      ret+=L'/'; 
    }
  }

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


  //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