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

[WIP] Fix ris import #2028

Merged
merged 5 commits into from
Sep 27, 2016
Merged

[WIP] Fix ris import #2028

merged 5 commits into from
Sep 27, 2016

Conversation

tschechlovdev
Copy link
Contributor

@tschechlovdev tschechlovdev commented Sep 21, 2016

Regarding: #1647
Doi import should now work with the DO field. Also I've added some fields, that are available in the RIS specification. I've also done some code cleanups.
#1074 should be also fixed now. I've added the scopus file as test file.

  • Tests created for changes
  • Manually tested changed features in running JabRef


String[] entries = sb.toString().replace("\u2013", "-").replace("\u2014", "--").replace("\u2015", "--")
String[] entries = linesAsString.replace("\u2013", "-").replace("\u2014", "--").replace("\u2015", "--")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could extract that method to the StringUtil class, e.g. call it ReplaceUnicodeDashes..

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. I've also used this method in the MedlinePlain importer.

Copy link
Contributor

@boceckts boceckts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some minor work at the test files is needed in my opinion. Otherwise LGTM 👍

editor = {some editor},
language = {eng},
number = {25},
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name of the test files confuses me a lot...Isn't the purpose here to test the journal title and doi fields? So why are the fields not present in the file?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah you're right... Don't know how I could forget them 😄

@@ -1,14 +1,14 @@
@incollection{,
author = {Barata, Catarina and Celebi, MEmre and Marques, JorgeS},
booktitle = {Dermoscopy Image Analysis},
comment = {doi:10.1201/b19107-2},
doi = {10.1201/b19107-2},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have seen that RisImporterTest3.ris specifies the both doi fields (M3 and DO) with the same doi string. Please move one of them to a different or new test file. This way the tests would have already showed that the DO field didn't import the doi.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've used the DO field in the TestDoiAndJournalFile.

@tschechlovdev
Copy link
Contributor Author

Travis fails, because the Architecture tests say, that the StringUtil class should be kept as small as possible ...

@Siedlerchr
Copy link
Member

Speak with @lenhard if it's okay to increase it and how to fix the test

@tschechlovdev
Copy link
Contributor Author

I tried to contact @lenhard, but didn't get an answer. So for the moment I think it is the best to remove the method from the StringUtil class, so that this PR don't have to wait to long. In addition it would only be 2 classes who would use this method.

Travis is still failing because of a DOI test.

@tschechlovdev tschechlovdev added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Sep 27, 2016
@Siedlerchr
Copy link
Member

Siedlerchr commented Sep 27, 2016

Yes, it is the proper way for the moment. We can think later on for moving it.
I would merge it in then

@Siedlerchr Siedlerchr merged commit 8a9aca1 into JabRef:master Sep 27, 2016
@lenhard
Copy link
Member

lenhard commented Sep 27, 2016

@tschechlovdev You contacted me? How? :-) This mention of myself is the first sign I see, but maybe I overlooked something.

@Siedlerchr
Copy link
Member

@lenhard The question was about the "Failing travis test" regarding the StringUtil method.
The ideas was to add a method for replacing unicode dashes:
String[] entries = linesAsString.replace("\u2013", "-").replace("\u2014", "--").replace("\u2015", "--")
which is also used in medline Plain.

@tobiasdiez
Copy link
Member

I know I'm late to the party, but one question: is this unicode dash needed for the page numbers? Because then there is a cleanup formatter which does the job (Page number normalizer, or some permutation of these words).

@stefan-kolb stefan-kolb mentioned this pull request Sep 28, 2016
@lenhard
Copy link
Member

lenhard commented Sep 28, 2016

The reason for moving more functionality to StringUtil in model was, if I recall it correctly, that the group fixes needed these methods. If the dash replacement functionality is not needed by model classes, why should it go into that package? If you need that in multiple importer classes, why not introduce a util class for the importer package?

mairdl pushed a commit to mairdl/jabref that referenced this pull request Sep 28, 2016
* fix ris importer

* fix ris import and add test cases

* address comments

* fix travis
@tschechlovdev tschechlovdev deleted the fix-ris-import branch October 10, 2016 10:39
zesaro pushed a commit to zesaro/jabref that referenced this pull request Nov 22, 2016
* fix ris importer

* fix ris import and add test cases

* address comments

* fix travis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants