sort by language

33 views
Skip to first unread message

Abbas Shahzadeh

unread,
Jun 18, 2011, 5:46:34 AM6/18/11
to citep...@googlegroups.com
Dear Mr. Bennett,
I have a bibliography consisting of references in three languages: English(en), Persian(fa) and Arabic(Ar). I want to sort references in bibliography, according to their language in this order: (Persian, Arabic, English). How can this be done in CSL?
Best regards,
Abbas

Frank Bennett

unread,
Jun 18, 2011, 7:37:40 PM6/18/11
to citeproc-js
The makeBibliography() method accepts filtering conditions, so as far
as citeproc-js is concerned, you can output the bibliography in three
separate segments. As far as I know, no clients yet support this
feature, though, so unless you are running citeproc-js independently,
clients will produce only a single bibliography, with items in the
order you get from a Unicode sort on the relevant keys.

If you are running in Zotero, and your style does not apply year-
suffix disambiguation, the least burdensome workaround is to set up a
collection for each language, drop the relevant items into each
collection, and then select all within each, generate a bibliography
in Zotero, and paste the result into the document.

In Zotero, at least, Implementing partitioned bibliography support
will require changes in both the word processor plugins and in Zotero
itself. With the extensive changes happening to implement Zotero
Everywhere, it will surely be awhile before anything happens on this
front. The window for implementation is probably a year or so down the
road. Meanwhile, if you're interested in taking a look at the
processor filitering mechanism, it's documented here:

http://gsl-nagoya-u.net/http/pub/citeproc-doc.html#selective-output

Frank

Abbas Shahzadeh

unread,
Jun 19, 2011, 2:04:35 AM6/19/11
to citep...@googlegroups.com
Thank you. And thanks for the proposed algorithm. I will implement it in Zotero. As a suggestion let me explain that in Zotero 2.0 I used to sort bibliography by this CSL macro:

  <macro name="language-sort1">
    <text locale="fa" value="1"/>
    <text locale="ar" value="2"/>
    <text locale="en" value="3"/>
  </macro>

and in the sort section:
    <sort>
      <key macro="language-sort1"/>
      <key macro="contributors"/>
      <key macro="anon"/>
      <key macro="recipient"/>
      <key variable="issued"/>
    </sort>

I had modified csl.js in a way that elements with loacle="fa" attribute was enabled only for Persian items and so on.




Reply all
Reply to author
Forward
0 new messages