Skip to content

JoseLlarena/pyaliner

Repository files navigation

Pyaliner

Library for aligning and visually comparing sequential data in the terminal.

paired ground-truth vs predicted comparison

compact

Compact paired ground-truth vs predicted

classic

Classic paired ground-truth vs predicted

inlined ground-truth vs predicted comparison

compact

Compact inlined ground-truth vs predicted

classic

Classic inlined ground-truth vs predicted

paired input vs ground-truth vs predicted comparison

compact

Compact paired input vs ground-truth vs predicted

classic

Classic paired input vs ground-truth vs predicted

paired ground-truth vs 1st predicted vs 2nd predicted comparison

Classic paired ground-truth vs 1st predicted vs 2nd predicted

alignment

>>> from pyaliner import align, COMPACT

>>> align('Example invalid invalid sentence'.split(), 'Example sentence'.split())
(('Example', 'invalid', 'invalid', 'sentence'), ('Example', '⎵', '⎵', 'sentence'))

>>> align('Example invalid invalid sentence'.split(), 'Example sentence'.split(), kind=COMPACT)
(('Example', 'invalid∙invalid', 'sentence'), ('Example', '⎵', 'sentence'))

Limitations

  • Three-way alignment uses a slow heuristic.
  • Wide characters, e.g., East Asian scripts, are not properly aligned with narrow ones

Installing

Install with pip:

pip install pyaliner

Testing

Unit tests are written with pytest and hypothesis. Run with:

pip install pytest hypothesis

pytest

Changelog

Check the Changelog for fixes and enhancements of each version.

License

Copyright Jose Llarena 2022

Distributed under the terms of the MIT license, Pyaliner is free and open source software.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages