Juris-M / citeproc-js

A JavaScript implementation of the Citation Style Language (CSL) https://citeproc-js.readthedocs.io
Other
305 stars 85 forks source link

Can't reach vendor neutral codes #168

Closed sam-gagnon closed 3 years ago

sam-gagnon commented 3 years ago

I've finally started working on the code for the McGill guide again, and while I remember @fbennett telling me the code used to call the ABBREV values for vendor neutral codes in a citation style or module, I can't for the life of me figure it out again.

fbennett commented 3 years ago

It's not at all intuitive. Use form="short" on the cs:institution element to abbreviate with institution-entire (AKA ABBREV). institution-part="short" abbreviates with institution-part (AKA abbrev/name).

fbennett commented 3 years ago

In the IndigoBook style, vendor-neutral cites are triggered by (1) a year set in in Year as Volume (collection-number), (2) empty Reporter (container-title), (3) the case number in page, and (4) a date (issued).

fbennett commented 3 years ago

Forgot to mention above: the Court is called as "authority" in CSL. (Not news, but for the benefit of others who drive by).

sam-gagnon commented 3 years ago

Thank you very much for the quick reply!

Ok, so I just went over to juris-us-indigotemp.csl and stole this portion of code for the juris-ca.csl that I'm working on:

            <names variable="dummy">
              <name/>
              <institution form="short"/>
              <substitute>
                <names variable="authority"/>
              </substitute>
            </names>

I then ran citeproc-test-runner on the jm-mcgill-v9-fr I'm making, but still ended up with "2018 court.appeal 305" instead of "2018 BCCA 305".

I know I had this working back in august, so I'm wondering if there's something else about the style module or the style itself I need to change, given all of the recent changes regard abbrevs and language selection.

Since the ABBREV value for this court is the same for both french and english, I didn't think language arbitration would have anything to do with it.

fbennett commented 3 years ago

The abbreviation infractructure has changed quite a bit in the latest releases, and the changes span the Abbrevs Filter, the Jurism client, and the processor. The test runner runs the processor outside of client context, and without the Abbrevs Filter, so it's probably just not finding the abbrevs there, and falling back to the literal court code. I need to replicate the selection logic in the test framework to make things work there. Your code looks fine.

In the interim, it's a headache, but if you try samples in the client, you should get better results. I'll try to get the test framework level with client expectations at the weekend.

On Thursday, October 15, 2020, Droitslinguistiques notifications@github.com wrote:

Thank you very much for the quick reply!

Ok, so I just went over to juris-us-indigotemp.csl and stole this portion of code for the juris-ca.csl that I'm working on:

        <names variable="dummy">
          <name/>
          <institution form="short"/>
          <substitute>
            <names variable="authority"/>
          </substitute>
        </names>

I then ran citeproc-test-runner on the jm-mcgill-v9-fr I'm making, but still ended up with "2018 court.appeal 305" instead of "2018 BCCA 305".

I know I had this working back in august, so I'm wondering if there's something else about the style module or the style itself I need to change, given all of the recent changes regard abbrevs and language selection.

Since the ABBREV value for this court is the same for both french and english, I didn't think language arbitration would have anything to do with it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Juris-M/citeproc-js/issues/168#issuecomment-708648329, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAASMSW4KFQP3XQCO5V55ELSKYEHJANCNFSM4SQ4GUXA .

fbennett commented 3 years ago

Despite these teething pains, I think we've cleared all of your requirements for proper support of Canadian referencing. I ran a simple ref to a Supreme Court case in the client, and with "fr" set on jurisdiction-preference of cs:style-options in cs:locale for xml:lang="fr" only, I got the French vendor-neutral code when the item was language "fr", and the English when it was not. So this should all work out nicely at the user end, once we get testing fixed for you.

On Thursday, October 15, 2020, Frank Bennett biercenator@gmail.com wrote:

The abbreviation infractructure has changed quite a bit in the latest releases, and the changes span the Abbrevs Filter, the Jurism client, and the processor. The test runner runs the processor outside of client context, and without the Abbrevs Filter, so it's probably just not finding the abbrevs there, and falling back to the literal court code. I need to replicate the selection logic in the test framework to make things work there. Your code looks fine.

In the interim, it's a headache, but if you try samples in the client, you should get better results. I'll try to get the test framework level with client expectations at the weekend.

On Thursday, October 15, 2020, Droitslinguistiques < notifications@github.com> wrote:

Thank you very much for the quick reply!

Ok, so I just went over to juris-us-indigotemp.csl and stole this portion of code for the juris-ca.csl that I'm working on:

        <names variable="dummy">
          <name/>
          <institution form="short"/>
          <substitute>
            <names variable="authority"/>
          </substitute>
        </names>

I then ran citeproc-test-runner on the jm-mcgill-v9-fr I'm making, but still ended up with "2018 court.appeal 305" instead of "2018 BCCA 305".

I know I had this working back in august, so I'm wondering if there's something else about the style module or the style itself I need to change, given all of the recent changes regard abbrevs and language selection.

Since the ABBREV value for this court is the same for both french and english, I didn't think language arbitration would have anything to do with it.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/Juris-M/citeproc-js/issues/168#issuecomment-708648329, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAASMSW4KFQP3XQCO5V55ELSKYEHJANCNFSM4SQ4GUXA .

sam-gagnon commented 3 years ago

I'm really grateful for the insane amount of work that you've put into this over the last few months. I know that all of the tools are there now, so while I still can't seem to get the client to output the vendor code correctly, I know it's user error and I'll figure it out eventually.

fbennett commented 3 years ago

Once I get testing up an running (might happen today!), I'll be happy to take a look at your CSL and abbrevs, if the are still things that aren't behaving as expected.

fbennett commented 3 years ago

I hit a speed bump with the beta, with the failure of a minor database upgrade. That's resolved now, but it's pushed back the work on the test framework by a day. Coming soon, though.

fbennett commented 3 years ago

Aaaaand we found another bug in the beta. Should be good now though. Today I'll turn to work on the test framework. More soon a bit later ...

fbennett commented 3 years ago

All known bugs fixed, and the test framework should be working now to produce the same results as the client. If you're turning abbreviations, you can now set a path to the juris-abbrevs directory in ~/cslrun.yaml or <repo>/cslrun.yaml with an "abbrevs" key.

fbennett commented 3 years ago

(All known bugs fixed in the Mac beta---when it's confirmed to work in the wild, I'll push it to a release, probably in the next day or two.)