public void addEvidence(Decision dPrv,String sFinalCategory){
  String sSuggestedCategory=(String)dPrv.FinalDecision;
  DocumentNGramGraph dDoc=(DocumentNGramGraph)dPrv.Document;
  if (sFinalCategory != null) {
    if (Repository.existsObject(sFinalCategory,INSECTDB.CATEGORY_TYPE)) {
      NamedDocumentNGramGraph cCat=(NamedDocumentNGramGraph)Repository.loadObject(sFinalCategory,INSECTDB.CATEGORY_TYPE);
      double dCatDocs=CategoryEvidenceCount.getValue(cCat.getName());
      cCat.merge(dDoc,dCatDocs == 0 ? 1.0 : (dCatDocs / ++dCatDocs));
      CategoryEvidenceCount.increaseValue(cCat.getName(),1.0);
      Repository.saveObject(cCat,sFinalCategory,INSECTDB.CATEGORY_TYPE);
    }
 else {
      NamedDocumentNGramGraph cCat=new NamedDocumentNGramGraph();
      cCat.setName(sFinalCategory);
      cCat.setDataString(dDoc.getDataString());
      Repository.saveObject(cCat,sFinalCategory,INSECTDB.CATEGORY_TYPE);
    }
    if (!sFinalCategory.equals(sSuggestedCategory)) {
      NamedDocumentNGramGraph cCat=(NamedDocumentNGramGraph)Repository.loadObject(sSuggestedCategory,INSECTDB.CATEGORY_TYPE);
      if (cCat != null) {
        cCat.degrade(dDoc);
        Repository.saveObject(cCat,sSuggestedCategory,INSECTDB.CATEGORY_TYPE);
      }
    }
  }
}

public void addEvidence ( Decision dPrv , String sFinalCategory ) { String sSuggestedCategory = ( String ) dPrv . FinalDecision ; DocumentNGramGraph dDoc = ( DocumentNGramGraph ) dPrv . Document ; if ( sFinalCategory != null ) { if ( Repository . existsObject ( sFinalCategory , INSECTDB . CATEGORY_TYPE ) ) { NamedDocumentNGramGraph cCat = ( NamedDocumentNGramGraph ) Repository . loadObject ( sFinalCategory , INSECTDB . CATEGORY_TYPE ) ; double dCatDocs = CategoryEvidenceCount . getValue ( cCat . getName ( ) ) ; cCat . merge ( dDoc , dCatDocs == 0 ? 1.0 : ( dCatDocs / ++ dCatDocs ) ) ; CategoryEvidenceCount . increaseValue ( cCat . getName ( ) , 1.0 ) ; Repository . saveObject ( cCat , sFinalCategory , INSECTDB . CATEGORY_TYPE ) ; } else { NamedDocumentNGramGraph cCat = new NamedDocumentNGramGraph ( ) ; cCat . setName ( sFinalCategory ) ; cCat . setDataString ( dDoc . getDataString ( ) ) ; Repository . saveObject ( cCat , sFinalCategory , INSECTDB . CATEGORY_TYPE ) ; } if ( ! sFinalCategory . equals ( sSuggestedCategory ) ) { NamedDocumentNGramGraph cCat = ( NamedDocumentNGramGraph ) Repository . loadObject ( sSuggestedCategory , INSECTDB . CATEGORY_TYPE ) ; if ( cCat != null ) { cCat . degrade ( dDoc ) ; Repository . saveObject ( cCat , sSuggestedCategory , INSECTDB . CATEGORY_TYPE ) ; } } } }
updates the evidence of the determiner with new data , with respect to a previous decision .
