Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes generated bibtex key and display of institute authors (JabRef#6479
) * Fix Pattern.compile for frequently used regexes * Fix one additional Pattern.compile * Fix style and unnecessary escape sequences * Fix invalid index in call to substring The original condition is evaluated to false. The substring is shorter than "uni". * Refactor name and javadoc of a regex * Fix use of compiled regex for matching department * Fix check for uppercase letter Perhaps the assumption should be that the letters are ASCII. If all letters are ASCII checking 'A' <= k.charAt(0) <= 'Z' might make more sense. I am not convinced about doing this with a regex. * Fix usage of uncompiled regex * Fix readability? * Add test cases Both test cases involves an author name containing department or school without university or institute of technology. * Fix `null` appearing as part of author name Corporate authors without university/institute of technology * Refactor name of capital regex pattern * Add debug output for reordering of names in fields * Add helper methods * Fix missing negation in "uni" matching * Fix test cases for corporate authors * Fix to keep all uppercase letters in abbreviation * Fix commented out code * Fix key for institution's name containing keyword If the name of an institution can't be split, assume that "School"/"Department" is part of the name. * Fix test case for short institution name * Refactor check for institution types * Refactor comments and names improving readability? * Refactor to improve readability and closure * Fix JavaDoc Minor typos and the "rest" part is now created differently. * Fix JavaDoc typos * Fix preliminary order for authors -> latexfree * Drop logger * Add convenience methods for cached latexfree names * Add name format method for names containing latex * Add call to formatNameLatexFree * Fix unclear statement in JavaDoc * Fix to only keep the first character of each word There are some examples that will turn out wrong if only capital letters are kept, e.g., "iOS Developer University Program". The original problem with "The School of Life" becoming too short is avoided by only removing school/department for names containing two or more ',' separated strings. This will still produce an unexpected result if the address of the institution is part of the authors field * Add latexfree Natbib test cases * Fix typo in latex-free test cases * Add Natbib test with escaped brackets * Add Natbib institution test with escaped brackets * Add test for latex-free comma separated lastnames * Add test for latex-free comma separated first name First name first and abbreviated first name first * Add test for latex-free comma separated last name Last name first and abbreviated first names * Fix adherence to JavaDoc and readability(?) * Fix readability(?) * Fix CheckStyle issues The deprecated static methods BibtexKeyGenerator.generateKey are moved to the test file as a similar convenience method is required for the test cases. Suppress warning has been added for some methods. * Fix CHANGELOG.md * Fix mistake in BibtexKeyGeneratorTest generateKey was not copy-pasted properly. * Add test for oxford comma * Fix miss-capitalization of enum * Fix fields not displayed latex-free * Fix in-line methods in MainTableNameFormatter * Fix in-line of generateKey() method * Fix separating tests into parsing/representation * Fix cache check and simplify expressions * Drop inlined methods * Fix most abbreviated abbreviations * Drop old formatName method * Refactor formatNameLatexFree The author list parsing is moved outside of the if/else statements * Refactor new parse tests * Add more parse tests * Drop all test cases containing escaped brackets * Refactor parse with latex tests Move them close to other parse tests * Fix my own spelling mistakes * Refactor abbreviation name
- Loading branch information