Package org.sf.mustru.search

Examples of org.sf.mustru.search.SearchQuestion


 
  //*-- test the generation of questions
  public void testBuildQuery()
  {
   System.out.println("Started testBuildQuery");
   SearchQuestion qp = new SearchQuestion();
   String question = "What did Richard Feynman say upon hearing he would receive the Nobel Prize in Physics?";

  // String question = "what is the capital of california?";
   System.out.println("Question: " + question);
   try { System.out.println("Generated query: " + qp.buildQuery(question)); }
   catch (IOException ie) { System.out.println("IO Error: " + ie.getMessage()); }
 
   System.out.println("Ended testBuildQuery");
  }
View Full Code Here


  }
 
  public void ttestQuestion()
  {
   System.out.println("Started testQuestion");
   SearchQuestion sq = new SearchQuestion();
//  String question = "What did Richard Feynman say upon hearing he would receive the Nobel Prize in Physics?";
   String question = "What is the capital of Italy ?";
   System.out.println("Question: " + question);  
  
   int ranks[] = {0, 1, 2, 3};
   String explanation = sq.explainAnswer(question, ranks);
//  String explanation = sq.explainAnswer(question);
   System.out.println("Exp: " + explanation);
   System.out.println("Ended testQuestion");
  }
View Full Code Here

   String fileName = null;
   try
   { fileName = "";
     String text = Files.readFromFile(new File("/big/trec/data/trec4/part5/data/FT941-4782.txt"));
     text = StringTools.filterChars(text);
     SearchQuestion sq = new SearchQuestion();
     String question = " How much did Mercury spend on advertising in 1993?";
     sq.buildQuery(question);
     String bestPassage[] = SearchTools.bestPassages(text, sq.getNouns(), sq.getVerbs(), sq.getAdjectives(), sq.getBigrams(), sq.getEntities() );
     System.out.println("Best: " + bestPassage[0]);
     System.out.println("Second best: " + bestPassage[1]);
   }
   catch (IOException ie) { System.err.println("File Error: " + fileName + " " + ie.getMessage()); }
  }
View Full Code Here

public QAStartup(RunQAStartup parent)
{ this.parent = parent; }

public void run()
running = true;   
    parent.setSq( new SearchQuestion());
    running = false;
}
View Full Code Here

  Constants.setDbt(dbt);
 
  try { is = SearchTools.getSearcher(Constants.getINDEXDIR(), false); }
  catch (IOException ie) { logger.error("IO Error " + ie.getMessage() ); }

  sQuestion = new SearchQuestion(); sQuery = new SearchQuery();
  try { dprops = new Properties(); dprops.load(new FileInputStream(Constants.DOCTYPES_FILE)); }
  catch (IOException e)  { logger.error("Could not read " + Constants.DOCTYPES_FILE + " " + e.getMessage()); }
}
View Full Code Here

TOP

Related Classes of org.sf.mustru.search.SearchQuestion

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.