citation-style-language / test-suite

11 stars 13 forks source link

Translation of quotes? #12

Open ndw opened 4 years ago

ndw commented 4 years ago

In the test affix_CommanAfterQuote.txt, the citation item is:

        {
            "id": "ITEM-1", 
            "prefix": "'quote',"
        }

but the expected output is:

“quote”, Hello Thing

I can't find anything in the specification that indicates that single quote characters should be translated into opening and closing typographic quotes. Why is the output from this test not:

'quote', Hello Thing
ndw commented 4 years ago

Similarly, the result in affix_MovingPunctuation.txt has double quotes translated into matching typographic quotes.

fbennett commented 4 years ago

The logic of quotation marks is not fully explained, but the tested behavior follows from the spec on Quotes ("the quotation marks used are terms"), and the term names specified under Appendix II: Terms ("open-quote/close-quote" and "open-inner-quote/close-inner-quote"). The "outer" and "inner" quotation forms are set by the locale, the input-side quotation markup is converted into an abstract nested structure, and the markup is applied according to the locale. To enable processing of native-language input, both straight single- and double-quote chars and the terms themselves are recognized for purposes of parsing the nested quote structure.

This "flip-flop" behavior was one of the first extensions to CSL proposed by Sean Takats at Zotero, early in the development of CSL 1.0.1.

ndw commented 4 years ago

So the interpretation of the string 'quote', is:

  1. abstract quote mark
  2. the string quote
  3. abstract quote mark
  4. the string ,

And the processor decides how to render the abstract quote marks, including whether or not the following punctuation , appears inside or outside them.

Do I have that right?

(I really don't see where that's specified, FWIW)

fbennett commented 4 years ago

That's right. If "follows from" is too strong an assertion, I'll softening it to, "compatible with." In any case, that's my recollection as an implementer. I'll leave discussion of the specification proper to the CSL maintainers.

bdarcus commented 4 years ago

Flagging this for a few people, since it bears on the clarity of the spec. Would be nice if we could plug these holes are Norm is identifying them, and we're working on resolving lingering issues on the schema.

@rmzelle @adam3smith @bwiernik @denismaier

bdarcus commented 4 years ago

My understanding of where we're at now:

@fbennett has now removed spec files that rely on undocumented modes (#16).

This one is not one of them, and the resolution of this is to document this behavior.

So I should probably move this to the documentation repo.

Correct?