Skip to content

Commit

Permalink
now 4 percent
Browse files Browse the repository at this point in the history
  • Loading branch information
amit223 committed Jan 1, 2019
1 parent e9c5995 commit ecb4352
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 13 deletions.
6 changes: 2 additions & 4 deletions src/main/java/Ranker.java
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,8 @@ private void rankDoc(int doc,Vector<Pair<String, Integer>> _termInDocAndTF, //do
if(maxBM25<rank){
maxBM25=rank;
}
// if(doc==93570)
// System.out.println(doc);
// System.out.println(doc);
docsAndRanks.put(doc,new Pair<>(rank,cosSim) );

docsAndRanks.put(doc,new Pair<>(rank,cosSim*0.01) );
}

/**
Expand Down
14 changes: 5 additions & 9 deletions src/main/java/Searcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private String treatSemantic(String query) {
BufferedReader bufferedReader =new BufferedReader(iSR);
String result = bufferedReader.readLine();
JSONArray words = new JSONArray(result);
int minLength = 15;
int minLength = 5;
StringBuffer similiarSemanticWords= new StringBuffer();
for (int i = 0; i<words.length() && i < minLength ; i++) {
JSONObject wordRecord = (JSONObject) words.get(i);
Expand Down Expand Up @@ -159,12 +159,8 @@ private void addDocsTo_doc_termPlusTfs(String term) {
_doc_termPlusTfs.get(docNum).add(new Pair<String, Integer>(term, termTfInDoc));
}
}
if(term.equalsIgnoreCase("British")){
System.out.println("Ff");
if(doc_tf.containsKey(325697)){
System.out.println("ss");
}
}
System.out.println("done add to doc tfs");

}

/**
Expand Down Expand Up @@ -217,8 +213,8 @@ else if (Character.isDigit(letter) || letter == '-')
int tf = byteToInt(tf_bytes);
if(!doc_tf.keySet().contains(docLine))
doc_tf.put(docLine,tf);
if(docLine==325697){
System.out.println("dd");
if(i==numOfDocs-2){
System.out.println("C");
}
}
raf.close();
Expand Down

0 comments on commit ecb4352

Please sign in to comment.