Skip to main content

ISO 4 abbreviation of publication titles in Python.

Project description

iso4

Implementation of ISO 4 (Rules for the abbreviation of title words and titles of publications) / CIEPS LTWA (ISSN International Centre's List of Title Word Abbreviations) as a Python library.

Usage

>>> from iso4 import abbreviate

>>> abbreviate("Recent Advances in Studies on Cardiac Structure and Metabolism")
'Recent Adv. Stud. Card. Struct. Metab.'

>>> abbreviate("Journal of the American Academy of Dermatology", periods=False)
'J Am Acad Dermatol'

>>> abbreviate("Real Living with Multiple Sclerosis")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  ...
Exception: Ambiguous word in title: real; must disambiguate between langs: eng, fre, spa

>>> abbreviate("Real Living with Multiple Sclerosis", disambiguation_langs=['eng'])
'Real Living Mult. Scler.'

>>> abbreviate("Anales de la Real Academia de Farmacia", True, ['spa'])
'An. R. Acad. Farm.'

VIM Plugin

A VIM plugin allows to abbreviate names directly from inside vim.

Install with Vundle

The easiest way to install the plugin is via a vim plugin manager. I use vundle Then, just add the following to your .vimrc file.

Plugin  'adlpr/iso4'

Then run :PluginInstall from within VIM.

Use

The following command will change the current line to its abbreviation

:ISO4

The command can also be used in visual mode.

Notes

  • Potential future improvements:
    • stricter treatment of language in general
    • better fuzzy matching with diacritics
    • conversion from non-Latin scripts
  • Consider this function fairly hacky as is; do not expect 100% accuracy!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iso4-0.0.2.tar.gz (886.5 kB view details)

Uploaded Source

File details

Details for the file iso4-0.0.2.tar.gz.

File metadata

  • Download URL: iso4-0.0.2.tar.gz
  • Upload date:
  • Size: 886.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.7

File hashes

Hashes for iso4-0.0.2.tar.gz
Algorithm Hash digest
SHA256 2d2563b117cf1fc2232f91f504ccb94a9e9fe240c70f1de252c84bb8847aef95
MD5 e41d1609d99bb34af538572a87464e58
BLAKE2b-256 a1a9d0b729ba8817496e5a09a1bd1ed7d65c7f8eec18d3e4b68381417e51c1cb

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page