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

Disambiguation fails for second names #210

Open
zepinglee opened this issue Jul 5, 2022 · 1 comment
Open

Disambiguation fails for second names #210

zepinglee opened this issue Jul 5, 2022 · 1 comment

Comments

@zepinglee
Copy link
Contributor

I'm recently working on the disambiguation feature of citeproc-lua and I come up with this test case. In the following fixture, both cites have original output "Doe, Roe" and disambiguation is required. Since only the second names are different ("Jane Roe" and "Jack Roe"), they are expanded to long form according to the disambiguation rule. The output is expected to be "Doe, Jane Roe; Doe, Jack Roe". However citeproc-js f56f8c9 produces "Doe, Roe; Doe, Roe" in which the second names are not disambiguated.

      + expected - actual

      -Doe, Roe; Doe, Roe
      +Doe, Jane Roe; Doe, Jack Roe
>>===== MODE =====>>
citation
<<===== MODE =====<<


>>===== RESULT =====>>
Doe, Jane Roe; Doe, Jack Roe
<<===== RESULT =====<<


>>===== CSL =====>>
<style
      xmlns="http://purl.org/net/xbiblio/csl"
      class="note"
      version="1.0">
  <info>
    <id />
    <title />
    <updated>2009-08-10T04:49:00+09:00</updated>
  </info>
  <citation
         disambiguate-add-givenname="true"
         givenname-disambiguation-rule="by-cite">
    <layout delimiter="; ">
      <names variable="author">
        <name form="short" />
      </names>
    </layout>
  </citation>
</style>
<<===== CSL =====<<


>>===== CITATION-ITEMS =====>>
[
    [
        {
            "id": "ITEM-1"
        },
        {
            "id": "ITEM-2"
        }
    ]
]
<<===== CITATION-ITEMS =====<<


>>===== INPUT =====>>
[
    {
        "author": [
            {
                "family": "Doe",
                "given": "John"
            },
            {
                "family": "Roe",
                "given": "Jane"
            }
        ],
        "id": "ITEM-1",
        "type": "book"
    },
    {
        "author": [
            {
                "family": "Doe",
                "given": "John"
            },
            {
                "family": "Roe",
                "given": "Jack"
            }
        ],
        "id": "ITEM-2",
        "type": "book"
    }
]
<<===== INPUT =====<<


>>===== VERSION =====>>
1.0
<<===== VERSION =====<<
@fbennett
Copy link
Contributor

fbennett commented Jul 5, 2022

Good catch on this, thank you for this report. I've confirmed the bug and I'm working on a fix. Kind of surprised and embarrassed that we didn't catch this straightforward failure earlier!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants