Skip to main content

Canonical references (e.g. “Hom. Il. 1,124-125”) use punctuation symbols in a consistent way, meaning that we can define a formal grammar to process them.

When encountering the reference “Hom. Il. 1,124-125”, the human reader will parse it as follows:

  • the text preceding the numbers contains information about work and author being cited

  • the hyphen is used to specify a range of text passages, e.g. lines 124 to 125;

  • the semicolon separates a reference from another within the sanme citation (is common to chain together references to mutiple of the same work or of different works);

  • the comma separates the hierarchical levels of the work being cited. In the example above 1,124-5 stands for from Book 1, Line 124 to Book 1, Line 125

  • when the citation scope is a range, the identical hierarchical level are collapsed: 1.124 - 1.125 can be written as both 1.124-125 or 1.124 s. without any loss of information for the human reader.

The CitationParser is composed by a lexer, a parser and a tree parser written in ANTLR and compiled into Python code. The parsed reference is then serialized into JSON.

An example:

>>> cp = CitationParser()
>>> cp.parse("Hom. Il. 1,124-125")
[{'work': u'Hom. Il.', 'scp': {'start': ['1', '124'], 'end': ['1', '125']}

Metadata

Release files for citation-parser 0.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for citation-parser 0.4.1
File Size Uploaded Provenance Actions
citation_parser-0.4.1.tar.gz 14.3 kB Without provenance Details for citation_parser-0.4.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for citation-parser 0.4.1
File Interpreter ABI Platform Actions
citation_parser-0.4.1-py2-none-any.whl Python 2 none any Details for citation_parser-0.4.1-py2-none-any.whl

Total release size: 32.8 kB

Release files / citation_parser-0.4.1.tar.gz

Download URL citation_parser-0.4.1.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
44ef08bf25795e3454182e976538d5e3e2d2bfdfc0bf81c254e9ad85166fe257
BLAKE2b-256 checksum
How to use checksums
cf2e81771bc14635e767853f1ca06d841fa6f4355a33012a896c8de9641b0223
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / citation_parser-0.4.1-py2-none-any.whl

Download URL citation_parser-0.4.1-py2-none-any.whl
Size 18.6 kB
Tags Python 2
SHA-256 checksum
How to use checksums
c127747f5cd34e2d41e8281942f56b03d1063f0a779b570d1ec9ad3b0af85ceb
BLAKE2b-256 checksum
How to use checksums
0367891e473acac551118c1821c3de0f5f91b25a347438688f0549682b24201e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for citation-parser 0.4.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.4.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page