Package gnu.trove

Examples of gnu.trove.TIntByteHashMap


   */
  public FeedbackDocument[] getFeedbackDocuments(Request request)
  {
    // get docids of the feedback documents
    String queryid = request.getQueryID();
    TIntByteHashMap list = queryidRelDocumentMap.get(queryid);
    //deal with undefined case
    if (list == null)
      return null;
    //deal with empty case
    if (list.size() == 0)
      return new FeedbackDocument[0];
    final List<FeedbackDocument> rtrList = new ArrayList<FeedbackDocument>(list.size());
    for(int id: list.keys())
    {
      FeedbackDocument doc = new FeedbackDocument();
      doc.docid = id;
      doc.score = -1;
      doc.rank = -1;
      doc.relevance = list.get(id);
      rtrList.add(doc);
    }
    //logger.info("Found "+(rtrList.size())+" feedback documents for query "+request.getQueryID());
    return rtrList.toArray(new FeedbackDocument[0]);
  }
View Full Code Here


      while ((line=br.readLine())!=null){
        line=line.trim();
        if (line.length()==0)
          continue;
        String[] parts = line.split("\\s+");
        TIntByteHashMap list = queryidRelDocumentMap.get(parts[0]);
        if (list == null)
        {
          queryidRelDocumentMap.put(parts[0], list = new TIntByteHashMap());
        }
        list.put(Integer.parseInt(parts[2]), Byte.parseByte(parts[3]));
        assessmentsCount++;
      }
      br.close();
      //logger.info("Total "+ assessmentsCount+ " assessments found");
    }catch(IOException ioe){
View Full Code Here

TOP

Related Classes of gnu.trove.TIntByteHashMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.