Skip to content

Commit

Permalink
Add zero weights for notes and comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
KunAndrew committed Aug 11, 2020
1 parent 6c8b7d7 commit c8bea4d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions src/main/java/org/jabref/logic/bibtex/DuplicateCheck.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ public class DuplicateCheck {
DuplicateCheck.FIELD_WEIGHTS.put(StandardField.EDITOR, 2.5);
DuplicateCheck.FIELD_WEIGHTS.put(StandardField.TITLE, 3.);
DuplicateCheck.FIELD_WEIGHTS.put(StandardField.JOURNAL, 2.);
DuplicateCheck.FIELD_WEIGHTS.put(StandardField.NOTE, 0.);
DuplicateCheck.FIELD_WEIGHTS.put(StandardField.COMMENT, 0.);
}

private final BibEntryTypesManager entryTypesManager;
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/org/jabref/model/entry/identifier/DOI.java
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,9 @@ public String getNormalized() {
}

public boolean isCompareNotExact(DOI o2) {
String s1 = this.doi.replaceAll("[^\\w]", "");
String s2 = o2.doi.replaceAll("[^\\w]", "");
return s1.equalsIgnoreCase(s2);
String s1 = this.doi.replaceAll("[^\\w]", "");
String s2 = o2.doi.replaceAll("[^\\w]", "");
return s1.equalsIgnoreCase(s2);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public void twoEntriesWithSameDoiButDifferentTypesAreDuplicates2() {

assertTrue(duplicateChecker.isDuplicate(simpleArticle, duplicateWithDifferentType, BibDatabaseMode.BIBTEX));
}

@Test
public void twoEntriesWithSameISBNButDifferentTypesAreDuplicates() {
simpleArticle.setField(StandardField.ISBN, "0-123456-47-9");
Expand Down

0 comments on commit c8bea4d

Please sign in to comment.