Ignore:
Timestamp:
2022-10-22T15:41:14+13:00 (19 months ago)
Author:
davidb
Message:

Coding developments that mean param passed arousal and valence values not used; query_resutls_ capped to max_docs_

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gs3-extensions/mars-src/trunk/src/java/org/greenstone/gsdl3/service/GS2WekaDBSearch.java

    r36857 r36859  
    5151    protected static final String RADIUS_PARAM  = "radius";
    5252    protected static final String MAXDOCS_PARAM = "maxDocs";
     53    protected static final String AROUSAL_PARAM  = "arousal";
     54    protected static final String VALENCE_PARAM  = "valence";
    5355
    5456    //protected static final String WEKA_MODEL_DEFAULT_DIRECTORY = "weka-model";
     
    115117        setStandardQueryParams (params); // ****
    116118       
    117         this.wekadb_src.runQuery (weka_db_index_dir, KNN_FEATURES_FILENAME, assoc_index_dir, query);
    118         Vector docs = this.wekadb_src.getQueryResult ();
     119        this.wekadb_src.runQuery(weka_db_index_dir, KNN_FEATURES_FILENAME, assoc_index_dir, query);
     120        Vector docs = this.wekadb_src.getQueryResult();
    119121
    120122        if (docs.isEmpty()) {
     
    145147        result.appendChild (document_list);
    146148        for (int d = 0; d < docs.size (); d++) {
    147             WekaDBDocInfo adb_doc = (WekaDBDocInfo) docs.elementAt(d);
    148 
    149             String doc_id  = adb_doc.getDocID();
    150             double rank    = adb_doc.getTopRank();
    151             String offsets = adb_doc.getOffsetList();
     149            WekaDBDocInfo wdb_doc = (WekaDBDocInfo) docs.elementAt(d);
     150
     151            String doc_id  = wdb_doc.getDocID();
     152            double rank    = wdb_doc.getTopRank();
     153            String offsets = wdb_doc.getOffsetList();
    152154
    153155            Element doc_node = createDocNode (result_doc, doc_id, Double.toString (rank));
     
    191193        int docs = Integer.parseInt(value);
    192194        this.wekadb_src.setMaxDocs(docs);
     195        }
     196        else if (name.equals(AROUSAL_PARAM)) {
     197        double arousal = Double.parseDouble(value);
     198        this.wekadb_src.setArousal(arousal);
     199        }       
     200        else if (name.equals(VALENCE_PARAM)) {
     201        double valence = Double.parseDouble(value);
     202        this.wekadb_src.setValence(valence);       
    193203        } // ignore any others
    194204    }
Note: See TracChangeset for help on using the changeset viewer.