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

[WIP] add function parse_bibtex_ordered #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

[WIP] add function parse_bibtex_ordered #4

wants to merge 2 commits into from

Conversation

asinghvi17
Copy link
Contributor

Adds a function parse_bibtex_ordered, which, instead of returning a Dict of Dicts, returns an Array of Dicts. This may be useful for determination of primacy in the CITATION.bib file format.

Adds a function `parse_bibtex_ordered`, which, instead of returning a Dict of Dicts, returns an Array of Dicts.  This may be useful for determination of primacy in the CITATION.bib file format.
@asinghvi17
Copy link
Contributor Author

using BibTeX

preamble, result = read(joinpath(pathof(BibTeX) |> dirname |> dirname, "example", "examples.bib"), String) |> parse_bibtex_ordered

result[1]

Dict{String,Dict{String,String}} with 1 entry:
  "westfahl:space" => Dict("crossref"=>"westfahl:frontier","indextitle"=>"True Frontier , The","author"=>"Westfahl , Gary","pages"=>"55-65","langidopts"=>"variant = american","langid"=>"english","title"=>"The True Frontier","annotation"=

@stevengj
Copy link
Collaborator

Should this just be the default?

@simonbyrne
Copy link
Collaborator

Why not use an OrderedDict from OrderedCollections.jl?

@simonbyrne
Copy link
Collaborator

Or if not that, an array of Pairs, as that can be easily converted into a Dict, OrderedDict, etc.

@Azzaare
Copy link

Azzaare commented Jul 19, 2020

I am in favor of OrderedDict (I did it on my "fork", and it is just a matter of changing one Dict to OrderedDict)

@mykelk
Copy link
Member

mykelk commented May 31, 2021

Should we go ahead an merge this?

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

Successfully merging this pull request may close these issues.

5 participants