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

AuthorListParser broken for "and others" #626

Closed
koppor opened this issue Sep 8, 2022 · 8 comments · Fixed by JabRef/jabref#9703
Closed

AuthorListParser broken for "and others" #626

koppor opened this issue Sep 8, 2022 · 8 comments · Fixed by JabRef/jabref#9703

Comments

@koppor
Copy link
Owner

koppor commented Sep 8, 2022

@TechReport{Ao2019TR,
  title  = {The Industrial Reference Architecture ({iRefA}) -- Description and User Guidance for System Architects},
  editor = {Alexander Artemenko and others},
  year   = {2019},
}

Why is Ao2019TR generated as BibTeX key and not Artmenko? The AuthorListParser is broken!

@Siedlerchr
Copy link
Collaborator

What's your citaiton key pattern?

@Siedlerchr
Copy link
Collaborator

Default [auth][year] pattern generates:


@TechReport{Artemenko2019,
  title  = {The Industrial Reference Architecture ({iRefA}) -- Description and User Guidance for System Architects},
  editor = {Alexander Artemenko and others},
  year   = {2019},
}

@k3KAW8Pnf7mkmdSMPHz27
Copy link
Collaborator

It could be the heuristics for companies/entities/organizations as well. It might get triggered (because only one name) and dislike the capitalization

@morganteg
Copy link

Hi, I'd like to contribute to fix the issue. I already have a fix idea that already make the AuthorListParserTest.java to be executed successfully. I only would to ask which Test Case should I execute in order to verify that the correct citation is generated:

@TechReport{Artemenko2019,
  title  = {The Industrial Reference Architecture ({iRefA}) -- Description and User Guidance for System Architects},
  editor = {Alexander Artemenko and others},
  year   = {2019},
}

Thanks, regards.

@Siedlerchr
Copy link
Collaborator

@morganteg That sounds great! I hope I understood you right, I think it should be sufficient to add a test case to CitationKeyGeneratorTest in addition to the AuthorListParserTest

@morganteg
Copy link

morganteg commented Mar 25, 2023

Yes, many thanks! I added the following test that should correctly test the issue:

@Test
void generateKeyCorrectKeyWithAndOthersAtTheEnd() {
    BibEntry entry = createABibEntryAuthor("Alexander Artemenko and others");
    entry.setField(StandardField.YEAR, "2019");
    assertEquals("Artemenko2019", generateKey(entry, "[auth][year]"));
}

If you agree, I will create a Pull Request with my changes.

Regards.

@Siedlerchr
Copy link
Collaborator

Yes that looks good! Go ahead!

@koppor
Copy link
Owner Author

koppor commented Apr 18, 2023

Citation Key generator is probably authorsAlpha. All keys are listed at https://docs.jabref.org/setup/citationkeypatterns#special-field-markers. Test class is /src/test/java/org/jabref/logic/citationkeypattern/CitationKeyGeneratorTest.java#L27.

koppor pushed a commit that referenced this issue Apr 20, 2023
…he end

#626
Remove the statement "and others" at the end of authors list in order to generate a correct citation key.
koppor pushed a commit that referenced this issue Apr 20, 2023
Move StringUtils.removeEndIgnoreCase to StringUtil class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants