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

void HMM::read_ambiguity_classes ( istream &  is  ) 

It reads the ambiguity classes from the stream received as input

Parameters:
is the input stream

Definition at line 148 of file HMM.C.

References Collection::add(), init(), and Collection::size().

                                       {
  int ntags;
  set<TTag> ambiguity_class;
  TTag tag;
  
  while (!is.eof()) {
    ntags = EndianUtil<int>::read(is);
    if(!is)
    {
      break;
    }
    ambiguity_class.clear();
    while (ntags>0) {
      tag = EndianUtil<TTag>::read(is);
      ntags--;          
      ambiguity_class.insert(tag);
    }
    
    if (ambiguity_class.size()>0) {
      output.add(ambiguity_class);
    }     
  }
  
  N = tags_index.size();
  M = output.size();  

  init();
}


Generated by  Doxygen 1.6.0   Back to index