Skip to content

Commit

Permalink
correcting some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
julsal committed Jul 26, 2017
1 parent 20ba9eb commit 937bec9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ public class RelatednessOneToManyRequest extends RelatednessRequest<RelatednessO

private String one;
private List<String> many;
private ScoreFunction scoreFunction;

public RelatednessOneToManyRequest one(String one) {
this.one = one;
Expand All @@ -45,11 +44,6 @@ public RelatednessOneToManyRequest many(List<String> many) {
return this;
}

public RelatednessOneToManyRequest scoreFunction(ScoreFunction scoreFunction) {
this.scoreFunction = Objects.requireNonNull(scoreFunction);
return this;
}

public String getOne() {
return one;
}
Expand All @@ -58,10 +52,6 @@ public List<String> getMany() {
return many;
}

public ScoreFunction getScoreFunction() {
return scoreFunction;
}

@Override
protected String isValid() {
String errors = super.isValid();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ protected RelatednessClient doCreate(RelatednessRequest request) {

@Override
protected String createKey(RelatednessRequest request) {
return request.getCorpus() + request.getLanguage() + request.getModel() + request.isMt();
return request.getCorpus() + request.getLanguage() + request.getModel() + request.isMt() + request.getFilter() + request.getFilterParam();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,13 @@ public void filtrateRelatedness(LinkedHashMap<String, Double> relatedness) {
int pos = relatedness.size();
Iterator<Map.Entry<String, Double>> iter = relatedness.entrySet().iterator();
Map.Entry<String, Double> previous = iter.next();

int count = 0;

while (previous.getValue() > 0.9 && iter.hasNext()) {
previous = iter.next();
count++;
}

while (iter.hasNext()) {
Map.Entry<String, Double> curr = iter.next();
count++;
Expand Down

0 comments on commit 937bec9

Please sign in to comment.