public void train(String sUpdateText,boolean bResetExisting){
  if (!bResetExisting)   FullTextDataString=FullTextDataString + sUpdateText;
 else   FullTextDataString=sUpdateText;
  for (int iCnt=iMinCharNGram; iCnt <= iMaxCharNGram; iCnt++) {
    DistributionDocument dCur=DistroDocs.get(iCnt);
    if (dCur != null)     if (!bResetExisting)     dCur.setDataString(sUpdateText,iCnt,bResetExisting);
 else     dCur.setDataString(FullTextDataString,iCnt,bResetExisting);
  }
  for (int iCnt=iMinWordNGram; iCnt <= iMaxWordNGram; iCnt++) {
    DistributionWordDocument dWordCur=DistroWordDocs.get(iCnt);
    if (dWordCur != null)     if (!bResetExisting)     dWordCur.setDataString(sUpdateText,iCnt,bResetExisting);
 else     dWordCur.setDataString(FullTextDataString,iCnt,bResetExisting);
  }
}

public void train ( String sUpdateText , boolean bResetExisting ) { if ( ! bResetExisting ) FullTextDataString = FullTextDataString + sUpdateText ; else FullTextDataString = sUpdateText ; for ( int iCnt = iMinCharNGram ; iCnt <= iMaxCharNGram ; iCnt ++ ) { DistributionDocument dCur = DistroDocs . get ( iCnt ) ; if ( dCur != null ) if ( ! bResetExisting ) dCur . setDataString ( sUpdateText , iCnt , bResetExisting ) ; else dCur . setDataString ( FullTextDataString , iCnt , bResetExisting ) ; } for ( int iCnt = iMinWordNGram ; iCnt <= iMaxWordNGram ; iCnt ++ ) { DistributionWordDocument dWordCur = DistroWordDocs . get ( iCnt ) ; if ( dWordCur != null ) if ( ! bResetExisting ) dWordCur . setDataString ( sUpdateText , iCnt , bResetExisting ) ; else dWordCur . setDataString ( FullTextDataString , iCnt , bResetExisting ) ; } }
performs the training of the distribution model .
