String queryText = query.getText();
queryText = queryText.replaceAll("[,'\\.\\?]", " ");
queryText = queryText.replaceAll(" ", " ").trim();
// need to lowercase the query vector
FeatureVector temp = new FeatureVector(null);
Iterator<String> qTerms = query.getFeatureVector().iterator();
while(qTerms.hasNext()) {
String term = qTerms.next();
temp.addTerm(term.toLowerCase(), query.getFeatureVector().getFeatureWeight(term));
}
temp.normalize();;
query.setFeatureVector(temp);
System.err.println(query.getTitle()+": "+queryText);
// perform search