Package org.apache.lucene.benchmark.quality

Examples of org.apache.lucene.benchmark.quality.QualityQuery


   
    // prepare topics
    File topicsFile = new File(srcTestDir, "trecTopics.txt");
    assertTrue("Bad topicsFile: "+topicsFile, topicsFile.exists()&& topicsFile.isFile());
    TrecTopicsReader qReader = new TrecTopicsReader();
    QualityQuery qqs[] = qReader.readQueries(new BufferedReader(new FileReader(topicsFile)));
   
    // prepare judge
    File qrelsFile = new File(srcTestDir, "trecQRels.txt");
    assertTrue("Bad qrelsFile: "+qrelsFile, qrelsFile.exists()&& qrelsFile.isFile());
    Judge judge = new TrecJudge(new BufferedReader(new FileReader(qrelsFile)));
View Full Code Here


        String qtext = line.substring(k+1).trim();
        // we got a topic!
        HashMap<String,String> fields = new HashMap<String,String>();
        fields.put(name,qtext);
        //System.out.println("id: "+id+" qtext: "+qtext+"  line: "+line);
        QualityQuery topic = new QualityQuery(id,fields);
        res.add(topic);
      }
    } finally {
      reader.close();
    }
    // sort result array (by ID)
    QualityQuery qq[] = res.toArray(new QualityQuery[0]);
    Arrays.sort(qq);
    return qq;
  }
View Full Code Here

        String narrative = sb.toString().trim();
        // we got a topic!
        fields.put("title",title);
        fields.put("description",description);
        fields.put("narrative", narrative);
        QualityQuery topic = new QualityQuery(id,fields);
        res.add(topic);
      }
    } finally {
      reader.close();
    }
    // sort result array (by ID)
    QualityQuery qq[] = res.toArray(new QualityQuery[0]);
    Arrays.sort(qq);
    return qq;
  }
View Full Code Here

        sb = read(reader,"<narr>",null,false,true);
        String descripion = sb.toString().trim();
        // we got a topic!
        fields.put("title",title);
        fields.put("description",descripion);
        QualityQuery topic = new QualityQuery(id,fields);
        res.add(topic);
        // skip narrative, get to end of doc
        read(reader,"</top>",null,false,false);
      }
    } finally {
      reader.close();
    }
    // sort result array (by ID)
    QualityQuery qq[] = res.toArray(new QualityQuery[0]);
    Arrays.sort(qq);
    return qq;
  }
View Full Code Here

   
    // prepare topics
    File topicsFile = new File(srcTestDir, "trecTopics.txt");
    assertTrue("Bad topicsFile: "+topicsFile, topicsFile.exists()&& topicsFile.isFile());
    TrecTopicsReader qReader = new TrecTopicsReader();
    QualityQuery qqs[] = qReader.readQueries(new BufferedReader(new FileReader(topicsFile)));
   
    // prepare judge
    File qrelsFile = new File(srcTestDir, "trecQRels.txt");
    assertTrue("Bad qrelsFile: "+qrelsFile, qrelsFile.exists()&& qrelsFile.isFile());
    Judge judge = new TrecJudge(new BufferedReader(new FileReader(qrelsFile)));
View Full Code Here

        String qtext = line.substring(k+1).trim();
        // we got a topic!
        HashMap fields = new HashMap();
        fields.put(name,qtext);
        //System.out.println("id: "+id+" qtext: "+qtext+"  line: "+line);
        QualityQuery topic = new QualityQuery(id,fields);
        res.add(topic);
      }
    } finally {
      reader.close();
    }
    // sort result array (by ID)
    QualityQuery qq[] = (QualityQuery[]) res.toArray(new QualityQuery[0]);
    Arrays.sort(qq);
    return qq;
  }
View Full Code Here

        sb = read(reader,"<narr>",null,false,true);
        String descripion = sb.toString().trim();
        // we got a topic!
        fields.put("title",title);
        fields.put("description",descripion);
        QualityQuery topic = new QualityQuery(id,fields);
        res.add(topic);
        // skip narrative, get to end of doc
        read(reader,"</top>",null,false,false);
      }
    } finally {
      reader.close();
    }
    // sort result array (by ID)
    QualityQuery qq[] = (QualityQuery[]) res.toArray(new QualityQuery[0]);
    Arrays.sort(qq);
    return qq;
  }
View Full Code Here

   
    // prepare topics
    File topicsFile = new File(srcTestDir, "trecTopics.txt");
    assertTrue("Bad topicsFile: "+topicsFile, topicsFile.exists()&& topicsFile.isFile());
    TrecTopicsReader qReader = new TrecTopicsReader();
    QualityQuery qqs[] = qReader.readQueries(new BufferedReader(new FileReader(topicsFile)));
   
    // prepare judge
    File qrelsFile = new File(srcTestDir, "trecQRels.txt");
    assertTrue("Bad qrelsFile: "+qrelsFile, qrelsFile.exists()&& qrelsFile.isFile());
    Judge judge = new TrecJudge(new BufferedReader(new FileReader(qrelsFile)));
View Full Code Here

        String narrative = sb.toString().trim();
        // we got a topic!
        fields.put("title",title);
        fields.put("description",description);
        fields.put("narrative", narrative);
        QualityQuery topic = new QualityQuery(id,fields);
        res.add(topic);
      }
    } finally {
      reader.close();
    }
    // sort result array (by ID)
    QualityQuery qq[] = res.toArray(new QualityQuery[0]);
    Arrays.sort(qq);
    return qq;
  }
View Full Code Here

        String qtext = line.substring(k+1).trim();
        // we got a topic!
        HashMap<String,String> fields = new HashMap<>();
        fields.put(name,qtext);
        //System.out.println("id: "+id+" qtext: "+qtext+"  line: "+line);
        QualityQuery topic = new QualityQuery(id,fields);
        res.add(topic);
      }
    } finally {
      reader.close();
    }
    // sort result array (by ID)
    QualityQuery qq[] = res.toArray(new QualityQuery[0]);
    Arrays.sort(qq);
    return qq;
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.benchmark.quality.QualityQuery

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.