Skip to content

Commit

Permalink
now entities vector!
Browse files Browse the repository at this point in the history
  • Loading branch information
Amit223 committed Dec 30, 2018
1 parent 8ebc36e commit 8db68dd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/main/java/Indexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,12 @@ private Collection<String> getFinal5Entities(Map<String,Integer> Entities) {
return RankedEntities.values();
**/
}

/**
* this function write the documents and the entities into final file:
* documents- in bytes
* entities- find best 5 and then in bytes.
*/
private void writeFilesAndEntitiesToFinalFile() {
File temp=new File(tempPathToEntities);
File end=new File(_path+"/Entities"+_toStem+".txt");
Expand Down Expand Up @@ -996,7 +1002,7 @@ private void ifExistUpdateTF(String term, int tf) {
int ptr=-1;
Vector v=new Vector();
v.add(df);
v.add(tf);
v.add(tottf);
v.add(ptr);
dictionary.remove(term);
dictionary.put(term,v);
Expand All @@ -1017,7 +1023,7 @@ else if(dictionary.containsKey(Reverse(term))){//the reversed term in dictionary
int ptr=-1;
Vector v=new Vector();
v.add(df);
v.add(tf);
v.add(tottf);
v.add(ptr);
dictionary.remove(term);
dictionary.put(newTerm,v);
Expand Down Expand Up @@ -1431,6 +1437,11 @@ private void Merge(String firstHalf,String lastHalf,String toWrite) {
}


/**
*
* @param line
* @return get the field which we sort by
*/
private static String getField(String line) {
if(line.contains("\\^")) {
String[] values = line.split("~");//valuse[0]-term, values[1]docLine-tf
Expand Down
10 changes: 10 additions & 0 deletions src/main/java/MainController.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ public class MainController {
private AnchorPane ap;


/**
*
* @param actionEvent
* open part a of project
*/
public void partAactivate(ActionEvent actionEvent) {
FXMLLoader fxmlLoader=new FXMLLoader();
Parent root = null;
Expand All @@ -32,6 +37,11 @@ public void partAactivate(ActionEvent actionEvent) {

}

/**
*
* @param actionEvent
* open part B of project
*/
public void partBactivate(ActionEvent actionEvent) {
FXMLLoader fxmlLoader=new FXMLLoader();
Parent root = null;
Expand Down

0 comments on commit 8db68dd

Please sign in to comment.