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

wstring LexTorWord::get_lexical_choice ( int  choice = -1,
bool  include_ignored = true 
)

Return the lexical choice at position 'choice', if 'choice' is not given the default one is returned

Definition at line 58 of file lextor_word.cc.

                                                               {
  if (word == L"") {
    if (include_ignored)
      return ignored_string;
    else 
      return L"";
  }

  if (choice<0)
    choice=default_choice;

  if (choice>=(int)lexical_choices.size()) {
    wcerr<<L"Error in LexTorWord::get_lexical_choice, choice position given is "
      <<L"greater than the number of choices available\n";
    wcerr<<L"position requested: "<<choice<<"\n";
    wcerr<<L"number of lexical choices: "<<lexical_choices.size()<<"\n";
    wcerr<<L"Returning default choice\n";
    choice=default_choice;
  }

  if (include_ignored)
    return ignored_string+L"^"+lexical_choices[choice]+L"$";
  else
    return lexical_choices[choice];
}


Generated by  Doxygen 1.6.0   Back to index