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 knwon ambiguity class that is a subset of the one received as a parameter. This is useful when a new ambiguty class is found because of changes in the morphological dictionary used by the MT system.

Parameters:
c set of tags (ambiguity class)
Returns:
a known ambiguity class

Definition at line 1127 of file HMM.C.

References Collection::size().

Referenced by tagger().

                                             {
  int size_ret = -1;
  set<TTag> ret=open_class; //Se devolverá si no encontramos ninguna clase mejor
  bool skeep_class;

  for(int k=0; k<M; k++) {
    if ((((int)output[k].size())>((int)size_ret)) && (((int)output[k].size())<((int)c.size()))) {
      skeep_class=false;
      // 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
         break;
      }
      }
      if (!skeep_class) {
        size_ret = output[k].size();
           ret = output[k];
      }
    }
  }
  return ret;
}


Generated by  Doxygen 1.6.0   Back to index