/*
 * $Id: PatentClassifyResultDocument.java,v 1.1 2004/12/21 10:29:17 koppy Exp $
 *
 * Copyright (c) Siemens AG 2008 
 *           (c) Universität Paderborn 2008 
 * Licensed under EUPL 1.1. 
 * 
 * Created on 20.12.2004
 *
 * $Log: PatentClassifyResultDocument.java,v $
 * Revision 1.1  2004/12/21 10:29:17  koppy
 * so einiges
 *
 */
package vkc.ws.axis.service.patent;

import vkc.db.entities.VKCDocument;

/**
 * This class represents
 * @author Andreas Koop
 */
public class PatentClassifyResultDocument {

    private VKCDocument vkcDoc = null;
    
    public PatentClassifyResultDocument( VKCDocument vkcDoc){
        this.vkcDoc = vkcDoc;
    }
    
    /**
     * Gibt eine Gewichtung zwischen 0 und 1 dieses Ergebnisdokumentes.
     * (Wird bei SummarizedClassifier verwendet!)
     * @return Gewichtung zwischen 0 und 1
     */
    public float getWeight(){
        if(this.vkcDoc == null){
            return 1.0f;
        }
        
        float weight = 0.0f;
        if(vkcDoc.getTitle().equals(ByKeywordClassifier.getName())){
            weight = SummarizedClassifier.BY_KEYWORDS_CLASSIFICATION_WEIGHT;
        }else if(vkcDoc.getTitle().equals(ByStdTDocumentsClassifier.getName())){
            weight = SummarizedClassifier.BY_STDT_DOCS_CLASSIFICATION_WEIGHT;
        }else if(vkcDoc.getTitle().equals(ByDocumentsClassifier.getName())){
            weight = SummarizedClassifier.BY_DOCUMENTS_CLASSIFICATION_WEIGHT;
        }
        
        if(weight < 0.0f || weight > 1.0f){
            return 1.0f;
        }
        
        return weight;

    }
    
    public VKCDocument getClassifyResultDoc() {
        return vkcDoc;
    }
}
