Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updates #5

Merged
merged 34 commits into from
Sep 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
7965eaa
Add abstract param layout formatter test (#11713)
leaf-soba Sep 8, 2024
d8b935e
Adds OpenFastTrace for requirements tracking (#11710)
koppor Sep 8, 2024
17b7697
Show only one notification when cutting an entry (#11724)
calixtus Sep 8, 2024
0b305ab
Remove unnecessary AI dependencies (#11727)
InAnYan Sep 8, 2024
f49dfac
Fix ArgumentProcessor (#11728)
koppor Sep 8, 2024
28164eb
New Crowdin updates (#11730)
Siedlerchr Sep 8, 2024
3df3b4f
Fixed an exception when searching for unlinked files. (#11731)
koppor Sep 8, 2024
85d8d8a
Add pref switch to not store url (#11735)
Siedlerchr Sep 9, 2024
1f7d900
Fix fetcher tests (#11737)
subhramit Sep 9, 2024
f3e7431
Remove AI service from OpenOfficePanel (#11733)
InAnYan Sep 9, 2024
5f7992b
Bump dev.langchain4j:langchain4j-hugging-face from 0.33.0 to 0.34.0 (…
dependabot[bot] Sep 9, 2024
85e503b
Bump org.yaml:snakeyaml from 2.2 to 2.3 (#11740)
dependabot[bot] Sep 9, 2024
3a507c1
Bump org.openrewrite.recipe:rewrite-recipe-bom from 2.17.0 to 2.18.0 …
dependabot[bot] Sep 9, 2024
408f4a4
Bump io.github.stefanbratanov:jvm-openai from 0.10.0 to 0.11.0 (#11742)
dependabot[bot] Sep 9, 2024
10bcb72
Bump src/main/resources/csl-styles from `2b15b1f` to `4e0902d` (#11743)
dependabot[bot] Sep 9, 2024
5e456c4
Bump buildres/abbrv.jabref.org from `b69f1d6` to `234cce8` (#11744)
dependabot[bot] Sep 9, 2024
d02a504
New Crowdin updates (#11745)
Siedlerchr Sep 9, 2024
7da71d6
Fix deprecated java api and minor refactor (#11747)
leaf-soba Sep 10, 2024
ce9e34f
Bump com.dlsc.gemsfx:gemsfx from 2.43.0 to 2.48.0 (#11739)
dependabot[bot] Sep 10, 2024
14ba56d
refactor BstTextPrefixer.textPrefix (#11746)
leaf-soba Sep 10, 2024
2de686e
finish ToDo in FieldFormatterCleanups (#11750)
leaf-soba Sep 11, 2024
eb98259
Update Gradle Wrapper from 8.10 to 8.10.1. (#11751)
koppor Sep 11, 2024
ba9de82
Fix search test NPE (#11749)
LoayGhreeb Sep 13, 2024
2a39416
Add Gemini LLM (#11736)
InAnYan Sep 13, 2024
f7fde15
Refactor EprintCleanup to handle institution, version, and EID fields…
18bce133 Sep 13, 2024
939f696
add unit test to generateInstitutionKey (#11756)
leaf-soba Sep 13, 2024
35b0516
Add setting: always add "Cited on pages" text to JStyles. (#11732)
heyitsdross Sep 13, 2024
9634a13
Enable/Disable the undo and redo toolbar/menu buttons correctly (#11758)
HoussemNasri Sep 13, 2024
67ca174
New Crowdin updates (#11760)
Siedlerchr Sep 14, 2024
7c958e7
Fix architecture gui/logic (#11729)
koppor Sep 15, 2024
86e9997
New translations jabref_en.properties (German) (#11762)
Siedlerchr Sep 15, 2024
86874f4
Add uses directive (#11761)
koppor Sep 15, 2024
e5757de
Fix undo not on fx thread exception (#11763)
Siedlerchr Sep 15, 2024
3dd1f86
Add Windows 11 VM (#11764)
koppor Sep 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Refactor EprintCleanup to handle institution, version, and EID fields (
…JabRef#11627)

* Refactor EprintCleanup to handle institution, version, and EID fields

* Add test for cleanup with VERSION, INSTITUTION, and EID

* Add version to EPRINT if not present

* Modify test to retain INSTITUTION as "tbd"; include documentation link

* clear institution field if it is "arXiv" else keep it as it is.

* Complied to OpenRewrite to ensure "modern" Java coding practices.

* Update CHANGELOG.md

* Add "real" hyperlink

---------

Co-authored-by: Subhramit Basu Bhowmick <subhramit.bb@live.in>
Co-authored-by: Oliver Kopp <kopp.dev@gmail.com>
  • Loading branch information
3 people authored Sep 13, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit f7fde15943ab52c153649046c6de967672128916
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -26,6 +26,7 @@ Note that this project **does not** adhere to [Semantic Versioning](https://semv
- We enabled creating a new file link manually. [#11017](https://github.com/JabRef/jabref/issues/11017)
- We added a toggle button to invert the selected groups. [#9073](https://github.com/JabRef/jabref/issues/9073)
- We reintroduced the floating search in the main table. [#4237](https://github.com/JabRef/jabref/issues/4237)
- We improved [cleanup](https://docs.jabref.org/finding-sorting-and-cleaning-entries/cleanupentries) of `arXiv` IDs in distributed in the fields `note`, `version`, `institution`, and `eid` fields. [#11306](https://github.com/JabRef/jabref/issues/11306)
- We added a switch not to store the linked file URL, because it caused troubles at other apps. [#11735](https://github.com/JabRef/jabref/pull/11735)
- When starting a new SLR, the selected catalogs now persist within and across JabRef sessions. [koppor#614](https://github.com/koppor/jabref/issues/614)
- We added a different background color to the search bar to indicate when the search syntax is wrong. [#11658](https://github.com/JabRef/jabref/pull/11658)
21 changes: 19 additions & 2 deletions src/main/java/org/jabref/logic/cleanup/EprintCleanup.java
Original file line number Diff line number Diff line change
@@ -13,18 +13,34 @@

/**
* Formats the DOI (e.g. removes http part) and also moves DOIs from note, url or ee field to the doi field.
*
* Background information on <a href="https://tex.stackexchange.com/questions/49757/what-should-an-entry-for-arxiv-entries-look-like-for-biblatex">tex.stackexchange</a>.
*/
public class EprintCleanup implements CleanupJob {

@Override
public List<FieldChange> cleanup(BibEntry entry) {
List<FieldChange> changes = new ArrayList<>();

for (Field field : Arrays.asList(StandardField.URL, StandardField.JOURNAL, StandardField.JOURNALTITLE, StandardField.NOTE)) {
Optional<String> version = entry.getField(StandardField.VERSION);
Optional<String> institution = entry.getField(StandardField.INSTITUTION);

for (Field field : Arrays.asList(StandardField.URL, StandardField.JOURNAL, StandardField.JOURNALTITLE, StandardField.NOTE, StandardField.EID)) {
Optional<ArXivIdentifier> arXivIdentifier = entry.getField(field).flatMap(ArXivIdentifier::parse);

if (arXivIdentifier.isPresent()) {
entry.setField(StandardField.EPRINT, arXivIdentifier.get().getNormalized())
String normalizedEprint = arXivIdentifier.get().getNormalized();

if (version.isPresent() && !normalizedEprint.contains("v" + version.get())) {
normalizedEprint += "v" + version.get();
}

if (institution.isPresent() && "arxiv".equalsIgnoreCase(institution.get())) {
entry.clearField(StandardField.INSTITUTION)
.ifPresent(changes::add);
}

entry.setField(StandardField.EPRINT, normalizedEprint)
.ifPresent(changes::add);

entry.setField(StandardField.EPRINTTYPE, "arxiv")
@@ -45,6 +61,7 @@ public List<FieldChange> cleanup(BibEntry entry) {
}
}
}
entry.clearField(StandardField.VERSION).ifPresent(changes::add);

return changes;
}
37 changes: 37 additions & 0 deletions src/test/java/org/jabref/logic/cleanup/EprintCleanupTest.java
Original file line number Diff line number Diff line change
@@ -27,4 +27,41 @@ void cleanupCompleteEntry() {

assertEquals(expected, input);
}

@Test
void cleanupEntryWithVersionAndInstitutionAndEid() {
BibEntry input = new BibEntry()
.withField(StandardField.NOTE, "arXiv: 1503.05173")
.withField(StandardField.VERSION, "1")
.withField(StandardField.INSTITUTION, "arXiv")
.withField(StandardField.EID, "arXiv:1503.05173");

BibEntry expected = new BibEntry()
.withField(StandardField.EPRINT, "1503.05173v1")
.withField(StandardField.EPRINTTYPE, "arxiv");

EprintCleanup cleanup = new EprintCleanup();
cleanup.cleanup(input);

assertEquals(expected, input);
}

@Test
void cleanupEntryWithOtherInstitution() {
BibEntry input = new BibEntry()
.withField(StandardField.NOTE, "arXiv: 1503.05173")
.withField(StandardField.VERSION, "1")
.withField(StandardField.INSTITUTION, "OtherInstitution")
.withField(StandardField.EID, "arXiv:1503.05173");

BibEntry expected = new BibEntry()
.withField(StandardField.EPRINT, "1503.05173v1")
.withField(StandardField.EPRINTTYPE, "arxiv")
.withField(StandardField.INSTITUTION, "OtherInstitution");

EprintCleanup cleanup = new EprintCleanup();
cleanup.cleanup(input);

assertEquals(expected, input);
}
}