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

void HMM::read_probabilities ( istream &  is  ) 

It reads the probabilities (matrices a and b) from the stream received as a parameter

Parameters:
is the input stream

Definition at line 195 of file HMM.C.

                                   {
  int i, j, k;
  
  //Matrix A
  for(i=0;i<N; i++)
    for(j=0; j<N; j++)
      a[i][j] = EndianUtil<double>::read(is);

  //Matrix B (only useful values)
  while (!is.eof()) {
    i = EndianUtil<int>::read(is);
    if(!is)
    {
      break;
    }
    k = EndianUtil<int>::read(is);
    b[i][k] = EndianUtil<double>::read(is);
  }
}


Generated by  Doxygen 1.6.0   Back to index