diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ed034b4b7f..59ab7e13f0e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ Note that this project **does not** adhere to [Semantic Versioning](http://semve ### Changed - The content of the field `timestamp` is migrated to `creationdate`. In case one configured "udpate timestampe", it is migrated to `modificationdate`. [koppor#130](https://github.com/koppor/jabref/issues/130) +- We fixed an issue where groups generated from authors' last names did not include all entries of the authors' [#5833](https://github.com/JabRef/jabref/issues/5833) - The export to MS Office XML now uses the month name for the field `MonthAcessed` instead of the two digit number [#7354](https://github.com/JabRef/jabref/issues/7354) ### Fixed diff --git a/src/main/java/org/jabref/model/entry/Author.java b/src/main/java/org/jabref/model/entry/Author.java index b325a3fa92f..ab94d260c43 100644 --- a/src/main/java/org/jabref/model/entry/Author.java +++ b/src/main/java/org/jabref/model/entry/Author.java @@ -3,49 +3,31 @@ import java.util.Objects; import java.util.Optional; +import org.jabref.model.strings.LatexToUnicodeAdapter; import org.jabref.model.strings.StringUtil; /** - * This is an immutable class that keeps information regarding single - * author. It is just a container for the information, with very simple - * methods to access it. + * This is an immutable class that keeps information regarding single author. It is just a container for the information, with very simple methods to access it. *
- * Current usage: only methods getLastOnly
,
- * getFirstLast
, and getLastFirst
are used;
- * all other methods are provided for completeness.
+ * Current usage: only methods getLastOnly
, getFirstLast
, and getLastFirst
are used; all other methods are provided for completeness.
*/
public class Author {
private final String firstPart;
-
private final String firstAbbr;
-
private final String vonPart;
-
private final String lastPart;
-
private final String jrPart;
+ private String latexFreeLastPart;
/**
- * Creates the Author object. If any part of the name is absent, null
- * must be passed; otherwise other methods may return erroneous results.
+ * Creates the Author object. If any part of the name is absent, null
must be passed; otherwise other methods may return erroneous results.
*
- * @param first the first name of the author (may consist of several
- * tokens, like "Charles Louis Xavier Joseph" in "Charles
- * Louis Xavier Joseph de la Vall{\'e}e Poussin")
- * @param firstabbr the abbreviated first name of the author (may consist of
- * several tokens, like "C. L. X. J." in "Charles Louis
- * Xavier Joseph de la Vall{\'e}e Poussin"). It is a
- * responsibility of the caller to create a reasonable
- * abbreviation of the first name.
- * @param von the von part of the author's name (may consist of several
- * tokens, like "de la" in "Charles Louis Xavier Joseph de la
- * Vall{\'e}e Poussin")
- * @param last the last name of the author (may consist of several
- * tokens, like "Vall{\'e}e Poussin" in "Charles Louis Xavier
- * Joseph de la Vall{\'e}e Poussin")
- * @param jr the junior part of the author's name (may consist of
- * several tokens, like "Jr. III" in "Smith, Jr. III, John")
+ * @param first the first name of the author (may consist of several tokens, like "Charles Louis Xavier Joseph" in "Charles Louis Xavier Joseph de la Vall{\'e}e Poussin")
+ * @param firstabbr the abbreviated first name of the author (may consist of several tokens, like "C. L. X. J." in "Charles Louis Xavier Joseph de la Vall{\'e}e Poussin"). It is a responsibility of the caller to create a reasonable abbreviation of the first name.
+ * @param von the von part of the author's name (may consist of several tokens, like "de la" in "Charles Louis Xavier Joseph de la Vall{\'e}e Poussin")
+ * @param last the last name of the author (may consist of several tokens, like "Vall{\'e}e Poussin" in "Charles Louis Xavier Joseph de la Vall{\'e}e Poussin")
+ * @param jr the junior part of the author's name (may consist of several tokens, like "Jr. III" in "Smith, Jr. III, John")
*/
public Author(String first, String firstabbr, String von, String last, String jr) {
firstPart = addDotIfAbbreviation(removeStartAndEndBraces(first));
@@ -198,9 +180,11 @@ private boolean properBrackets(String s) {
* Removes start and end brace at a string
*
* E.g., - * * {Vall{\'e}e Poussin} -> Vall{\'e}e Poussin - * * {Vall{\'e}e} {Poussin} -> Vall{\'e}e Poussin - * * Vall{\'e}e Poussin -> Vall{\'e}e Poussin + *
null
, the empty string ""
- * is returned.
+ * Returns von-part followed by last name ("von Last"). If both fields were specified as null
, the empty string ""
is returned.
*
* @return 'von Last'
*/
@@ -319,13 +308,10 @@ public String getLastOnly() {
}
/**
- * Returns the author's name in form 'von Last, Jr., First' with the
- * first name full or abbreviated depending on parameter.
+ * Returns the author's name in form 'von Last, Jr., First' with the first name full or abbreviated depending on parameter.
*
- * @param abbr true
- abbreviate first name, false
-
- * do not abbreviate
- * @return 'von Last, Jr., First' (if abbr==false
) or
- * 'von Last, Jr., F.' (if abbr==true
)
+ * @param abbr true
- abbreviate first name, false
- do not abbreviate
+ * @return 'von Last, Jr., First' (if abbr==false
) or 'von Last, Jr., F.' (if abbr==true
)
*/
public String getLastFirst(boolean abbr) {
StringBuilder res = new StringBuilder(getLastOnly());
@@ -339,13 +325,10 @@ public String getLastFirst(boolean abbr) {
}
/**
- * Returns the author's name in form 'First von Last, Jr.' with the
- * first name full or abbreviated depending on parameter.
+ * Returns the author's name in form 'First von Last, Jr.' with the first name full or abbreviated depending on parameter.
*
- * @param abbr true
- abbreviate first name, false
-
- * do not abbreviate
- * @return 'First von Last, Jr.' (if abbr==false
) or 'F.
- * von Last, Jr.' (if abbr==true
)
+ * @param abbr true
- abbreviate first name, false
- do not abbreviate
+ * @return 'First von Last, Jr.' (if abbr==false
) or 'F. von Last, Jr.' (if abbr==true
)
*/
public String getFirstLast(boolean abbr) {
StringBuilder res = new StringBuilder();
@@ -372,11 +355,9 @@ public String toString() {
}
/**
- * Returns the name as "Last, Jr, F." omitting the von-part and removing
- * starting braces.
+ * Returns the name as "Last, Jr, F." omitting the von-part and removing starting braces.
*
- * @return "Last, Jr, F." as described above or "" if all these parts
- * are empty.
+ * @return "Last, Jr, F." as described above or "" if all these parts are empty.
*/
public String getNameForAlphabetization() {
StringBuilder res = new StringBuilder();
diff --git a/src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java b/src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java
index f113ed38ad8..bd31c03a674 100644
--- a/src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java
+++ b/src/main/java/org/jabref/model/groups/AutomaticPersonsGroup.java
@@ -1,19 +1,15 @@
package org.jabref.model.groups;
import java.util.Objects;
-import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
-import org.jabref.model.entry.Author;
-import org.jabref.model.entry.AuthorList;
import org.jabref.model.entry.BibEntry;
import org.jabref.model.entry.field.Field;
-import org.jabref.model.util.OptionalUtil;
public class AutomaticPersonsGroup extends AutomaticGroup {
- private Field field;
+ private final Field field;
public AutomaticPersonsGroup(String name, GroupHierarchyType context, Field field) {
super(name, context);
@@ -44,16 +40,11 @@ public AbstractGroup deepCopy() {
@Override
public Set