Package edu.wiki.search

Examples of edu.wiki.search.ESASearcher


   * @throws IOException
   * @throws SQLException
   * @throws ClassNotFoundException
   */
  public static void main(String[] args) throws ClassNotFoundException, SQLException, IOException {
    ESASearcher searcher = new ESASearcher();
   
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in,"UTF-8"));
    String doc1 = br.readLine();
    String doc2 = br.readLine();
    br.close();
   
    System.out.println(searcher.getRelatedness(doc1, doc2));
  }
View Full Code Here


   * @throws IOException
   * @throws SQLException
   * @throws ClassNotFoundException
   */
  public static void main(String[] args) throws ClassNotFoundException, SQLException, IOException {
    ESASearcher searcher = new ESASearcher();
    initDB();
   
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in,"UTF-8"));
    String text = in.readLine();
   
    IConceptVector cvBase = searcher.getConceptVector(text);
    IConceptVector cv = searcher.getNormalVector(cvBase,10);
   
    if(cv == null){
      System.exit(1);
    }
   
View Full Code Here

   * @throws IOException
   * @throws SQLException
   * @throws ClassNotFoundException
   */
  public static void main(String[] args) throws ClassNotFoundException, SQLException, IOException {
    ESASearcher searcher = new ESASearcher();
    initDB();
   
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in,"UTF-8"));
    String text = in.readLine();
   
    IConceptVector cv = searcher.getCombinedVector(text);
   
    if(cv == null){
      System.exit(1);
    }
   
View Full Code Here

   * @throws IOException
   * @throws SQLException
   * @throws ClassNotFoundException
   */
  public static void main(String[] args) throws ClassNotFoundException, SQLException, IOException {
    ESASearcher searcher = new ESASearcher();
    String line;
    double val;
    DecimalFormat df = new DecimalFormat("#.##########");
   
    // read Wordsim-353 human judgements
    InputStream is = IndexModifier.class.getResourceAsStream("/config/wordsim353-combined.tab");
    BufferedReader br = new BufferedReader(new InputStreamReader(is));
    br.readLine(); //skip first line
    System.out.println("Word 1\tWord 2\tHuman (mean)\tScore");
    while((line = br.readLine()) != null){
      final String [] parts = line.split("\t");
      if(parts.length != 3)
        break;
     
      val = searcher.getRelatedness(parts[0], parts[1]);
     
      if(val == -1){
        System.out.println(line + "\t0");
      }
      else {
View Full Code Here

    super.init(config);
    context = config.getServletContext() ;
   
    nwd = new NormalizedWikipediaDistance(context.getInitParameter("index_path"));
    try {
      esa = new ESASearcher();
      initDB();
    } catch (Exception e) {
      e.printStackTrace();
      throw new ServletException();
    }
View Full Code Here

   * @throws IOException
   * @throws SQLException
   * @throws ClassNotFoundException
   */
  public static void main(String[] args) throws ClassNotFoundException, SQLException, IOException {
    ESASearcher searcher = new ESASearcher();
    initDB();
   
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String text = in.readLine();
   
    IConceptVector cvBase = searcher.getConceptVector(text);
    IConceptVector cvNormal = searcher.getNormalVector(cvBase,10);
    IConceptVector cv = searcher.getLinkVector(cvNormal,10);
   
    if(cv == null){
      System.exit(1);
    }
   
View Full Code Here

TOP

Related Classes of edu.wiki.search.ESASearcher

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.