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

set< TTag > HMM::find_similar_ambiguity_class ( set< TTag >  c  )  [private]

This method returns a known ambiguity class that is a subset of the one received as a parameter. This is useful when a new ambiguity class is found because of changes in the morphological dictionary used by the MT system.

c set of tags (ambiguity class)
a known ambiguity class

Definition at line 854 of file hmm.cc.

References Collection::size().

Referenced by tagger().

  int size_ret = -1;
  set<TTag> ret=td->getOpenClass(); //Se devolverá si no encontramos ninguna clase mejor
  bool skeep_class;
  Collection &output = td->getOutput();

  for(int k=0; k<td->getM(); k++) {
    if ((((int)output[k].size())>((int)size_ret)) && (((int)output[k].size())<((int)c.size()))) {
      // Test if output[k] is a subset of class
      for(set<TTag>::iterator it=output[k].begin(); it!=output[k].end(); it++) {
        if (c.find(*it)==c.end()) { 
         skeep_class=true; //output[k] is not a subset of class
      if (!skeep_class) {
        size_ret = output[k].size();
           ret = output[k];
  return ret;

Generated by  Doxygen 1.6.0   Back to index