-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
fix for 9699. Added bimap for language-lcid mapping #9729
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
7c344f4
fix for 9699. Added bimap for language-lcid mapping
yennie02 7fa2a14
removed comments
yennie02 ffa8e9d
Merge branch 'main' into fix-for-9699
Siedlerchr 67b18d7
unit test fixes/invalid lang handling + added unit tests
yennie02 b31489f
Merge branch 'fix-for-9699' of https://github.com/yenniejunvu/jabref …
yennie02 671a4f7
added missing files
yennie02 c79eb5b
use getOrDefault
yennie02 d8d73c0
comment added
yennie02 d9f464d
Update CHANGELOG.md
Siedlerchr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/test/java/org/jabref/logic/msbib/MSBibConverterTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| package org.jabref.logic.msbib; | ||
|
|
||
| import java.util.Optional; | ||
|
|
||
| import org.jabref.model.entry.BibEntry; | ||
| import org.jabref.model.entry.field.StandardField; | ||
| import org.jabref.model.entry.types.StandardEntryType; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
|
||
| class MSBibConverterTest { | ||
|
|
||
| private final BibEntry BIB_ENTRY_TEST = new BibEntry(StandardEntryType.InProceedings) | ||
| .withField(StandardField.AUTHOR, "Igor Steinmacher and Tayana Uchoa Conte and Christoph Treude and Marco Aurélio Gerosa") | ||
| .withField(StandardField.DATE, "14-22 May 2016") | ||
| .withField(StandardField.YEAR, "2016") | ||
| .withField(StandardField.EVENTDATE, "14-22 May 2016") | ||
| .withField(StandardField.EVENTTITLEADDON, "Austin, TX, USA") | ||
| .withField(StandardField.LOCATION, "Austin, TX, USA") | ||
| .withField(StandardField.DOI, "10.1145/2884781.2884806") | ||
| .withField(StandardField.JOURNALTITLE, "2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE)") | ||
| .withField(StandardField.PAGES, "273--284") | ||
| .withField(StandardField.ISBN, "978-1-5090-2071-3") | ||
| .withField(StandardField.ISSN, "1558-1225") | ||
| .withField(StandardField.LANGUAGE, "english") | ||
| .withField(StandardField.PUBLISHER, "IEEE") | ||
| .withField(StandardField.KEYWORDS, "Portals, Documentation, Computer bugs, Joining processes, Industries, Open source software, Newcomers, Newbies, Novices, Beginners, Open Source Software, Barriers, Obstacles, Onboarding, Joining Process") | ||
| .withField(StandardField.TITLE, "Overcoming Open Source Project Entry Barriers with a Portal for Newcomers") | ||
| .withField(StandardField.FILE, ":https\\://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=7886910:PDF"); | ||
|
|
||
| private BibEntry entry; | ||
|
|
||
| @Test | ||
| void convert() { | ||
| entry = BIB_ENTRY_TEST; | ||
| MSBibConverter.convert(entry); | ||
|
|
||
| assertEquals(Optional.of("english"), entry.getField(StandardField.LANGUAGE)); | ||
| } | ||
| } |
31 changes: 31 additions & 0 deletions
31
src/test/java/org/jabref/logic/msbib/MsBibMappingTest.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| package org.jabref.logic.msbib; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
|
|
||
| import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
|
||
| public class MsBibMappingTest { | ||
koppor marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| @Test | ||
| public void testGetLanguage() { | ||
| String lang = MSBibMapping.getLanguage(1609); | ||
| assertEquals("basque", lang); | ||
| } | ||
|
|
||
| @Test | ||
| public void testGetLCID() { | ||
| int lcid = MSBibMapping.getLCID("basque"); | ||
| assertEquals(1609, lcid); | ||
| } | ||
|
|
||
| @Test | ||
| public void testGetInvalidLanguage() { | ||
| String lang = MSBibMapping.getLanguage(1234567); | ||
| assertEquals("english", lang); | ||
| } | ||
|
|
||
| @Test | ||
| public void testInvalidLCID() { | ||
| int lcid = MSBibMapping.getLCID("not a language"); | ||
| assertEquals(1033, lcid); | ||
| } | ||
| } | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Siedlerchr What is "LibreExpoa"? Is this change in CHANGELOG.md really intended?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was editing this on the github, this was not intended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it directly in
mainat 461e915