Skip to content

Commit

Permalink
Merge pull request #149 from chrislit/0.3.6
Browse files Browse the repository at this point in the history
0.3.6
  • Loading branch information
chrislit committed Nov 17, 2018
2 parents f435470 + c0060e6 commit 71985bb
Show file tree
Hide file tree
Showing 335 changed files with 44,142 additions and 27,188 deletions.
2 changes: 1 addition & 1 deletion .codeclimate.yml
Expand Up @@ -22,4 +22,4 @@ exclude_patterns:
- "docs/"
- "setup.py"
- "badge_update.py"
- "_bmdata.py"
- "_beider_morse_data.py"
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -18,17 +18,17 @@ matrix:

notifications:
email: false

# Install packages
install:
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then travis_retry pip install pyliblzma; fi
- travis_retry pip install coveralls
- travis_retry python setup.py install

# Run test
script:
- nosetests --verbose --with-coverage --cover-erase --cover-branches --cover-package=abydos --logging-level=INFO --process-timeout=60 --process-restartworker

# Calculate coverage
after_success:
- coveralls --verbose --rcfile=.coveragerc
14 changes: 12 additions & 2 deletions CODING_STANDARDS.rst
@@ -1,6 +1,14 @@
CODING STANDARDS
----------------

- nosetest will be used for testing
- flake8 will be used for best practice conformance
- pydocstyle will be used to ensure documentation style conformance to PEP257
(for the most part) and NumPy documentation style
- black will be used to keep code style consistent

----

git commits
~~~~~~~~~~~

Expand All @@ -15,6 +23,8 @@ git pushes
A git push should be performed only under the following conditions:

- library is syntactically correct (compiling correctly) in both Python 2 & 3
- library passes all tests according to nosetests in both Python 2 & 3
- library passes all tests and doctests according to nosetests in both Python 2
& 3
- test coverage is 100% according to nosetests
- using the included pylint.rc, pylint reports a 10/10 rating
- flake8 and pydocstyle should report 0 issues
- black code styling has been applied
16 changes: 16 additions & 0 deletions HISTORY.rst
Expand Up @@ -2,6 +2,22 @@ Release History
---------------


0.3.6 (2018-11-17) *classy carl*
++++++++++++++++++++++++++++++++

doi:10.5281/zenodo.1490288

Changes:

- Most functions were encapsulated into classes.
- Each class is broken out into its own file, with test files paralleling
library files.
- Documentation was converted from Sphinx markup to Numpy style.
- A tutorial was written for each subpackage.
- Documentation was cleaned up, with math markup corrections and many
additional links.


0.3.5 (2018-10-31) *cantankerous carl*
++++++++++++++++++++++++++++++++++++++

Expand Down
49 changes: 32 additions & 17 deletions README.rst
Expand Up @@ -8,13 +8,13 @@ Abydos
+------------------+------------------------------------------------------+
| Dependencies | |requires| |snyk| |pyup| |fossa| |
+------------------+------------------------------------------------------+
| Local Analysis | |pylint| |flake8| |black| |
| Local Analysis | |pylint| |flake8| |pydocstyle| |black| |
+------------------+------------------------------------------------------+
| Usage | |docs| |mybinder| |license| |sourcerank| |zenodo| |
+------------------+------------------------------------------------------+
| Contribution | |cii| |waffle| |openhub| |
+------------------+------------------------------------------------------+
| PyPI | |pypi| |pypi-ver| |
| PyPI | |pypi| |pypi-dl| |pypi-ver| |
+------------------+------------------------------------------------------+
| conda-forge | |conda| |conda-dl| |conda-platforms| |
+------------------+------------------------------------------------------+
Expand Down Expand Up @@ -71,14 +71,18 @@ Abydos
:target: https://app.fossa.io/projects/git%2Bgithub.com%2Fchrislit%2Fabydos?ref=badge_shield
:alt: FOSSA Status

.. |pylint| image:: https://img.shields.io/badge/Pylint-9.5/10-green.svg
.. |pylint| image:: https://img.shields.io/badge/Pylint-9.16/10-yellowgreen.svg
:target: #
:alt: Pylint Score

.. |flake8| image:: https://img.shields.io/badge/flake8-2-green.svg
.. |flake8| image:: https://img.shields.io/badge/flake8-0-brightgreen.svg
:target: #
:alt: flake8 Errors

.. |pydocstyle| image:: https://img.shields.io/badge/pydocstyle-0-brightgreen.svg
:target: #
:alt: pydocstyle Errors

.. |black| image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/ambv/black
:alt: black
Expand All @@ -91,16 +95,16 @@ Abydos
:target: https://mybinder.org/v2/gh/chrislit/abydos/master?filepath=binder
:alt: Binder

.. |license| image:: https://img.shields.io/badge/License-GPL%20v3-blue.svg
.. |license| image:: https://img.shields.io/badge/License-GPL%20v3+-blue.svg
:target: https://www.gnu.org/licenses/gpl-3.0
:alt: License: GPL v3
:alt: License: GPL v3.0+

.. |sourcerank| image:: https://img.shields.io/librariesio/sourcerank/pypi/abydos.svg
:target: https://libraries.io/pypi/abydos
:alt: Libraries.io SourceRank

.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1462443.svg
:target: https://doi.org/10.5281/zenodo.1463204
.. |zenodo| image:: https://zenodo.org/badge/DOI/10.5281/zenodo.1490288.svg
:target: https://doi.org/10.5281/zenodo.1490288
:alt: Zenodo

.. |cii| image:: https://bestpractices.coreinfrastructure.org/projects/1598/badge
Expand All @@ -119,7 +123,11 @@ Abydos
:target: https://pypi.python.org/pypi/abydos
:alt: PyPI

.. |pypi-ver| image:: https://img.shields.io/pypi/pyversions/abydos.svg
.. |pypi-dl| image:: https://img.shields.io/pypi/dm/abydos.svg
:target: https://pypi.python.org/pypi/abydos
:alt: PyPI downloads/month

.. |pypi-ver| image:: https://img.shields.io/pypi/pyversions/abydos.svg
:target: https://pypi.python.org/pypi/abydos
:alt: PyPI versions

Expand All @@ -138,11 +146,12 @@ Abydos
|
.. image:: https://raw.githubusercontent.com/chrislit/abydos/master/abydos-small.png
:target: https://github.com/chrislit/abydos
:alt: abydos
:align: right

|
| Abydos NLP/IR library
| `Abydos NLP/IR library <https://github.com/chrislit/abydos>`_
| Copyright 2014-2018 by Christopher C. Little
Abydos is a library of phonetic algorithms, string distance measures & metrics,
Expand Down Expand Up @@ -188,6 +197,7 @@ stemmers, and string fingerprinters including:
- SoundexBR
- NRL English-to-phoneme
- Beider-Morse Phonetic Matching

- String distance metrics
- Levenshtein distance
- Optimal String Alignment distance
Expand All @@ -212,7 +222,7 @@ stemmers, and string fingerprinters including:
- Monge-Elkan similarity & distance
- Matrix similarity
- Needleman-Wunsch score
- Smither-Waterman score
- Smith-Waterman score
- Gotoh score
- Length similarity
- Prefix, Suffix, and Identity similarity & distance
Expand All @@ -226,6 +236,7 @@ stemmers, and string fingerprinters including:
- Typo distance
- Indel distance
- Synoname

- Stemmers
- the Lovins stemmer
- the Porter and Porter2 (Snowball English) stemmers
Expand All @@ -236,6 +247,7 @@ stemmers, and string fingerprinters including:
- Paice-Husk Stemmer
- Schinke Latin stemmer
- S stemmer

- String Fingerprints
- string fingerprint
- q-gram fingerprint
Expand All @@ -248,6 +260,7 @@ stemmers, and string fingerprinters including:
- Cisłak & Grabowski's position fingerprint
- Synoname Toolcode


-----

Installation
Expand Down Expand Up @@ -279,7 +292,7 @@ To install Abydos (latest release) from PyPI using pip::

pip install abydos

To install from `conda-forge <https://conda-forge.org/>`_::
To install from `conda-forge <https://anaconda.org/conda-forge/abydos>`_::

conda install abydos

Expand All @@ -292,10 +305,10 @@ To run the whole test-suite just call tox::

tox

The tox setup has the following environments: py27, py36, doctest,
py27-regression, py36-regression, pylint, pycodestyle, flake8, doc8,
badges, docs, py27-fuzz, & py36-fuzz. So if only want to generate documentation
(in HTML, EPUB, & PDF formats), just call::
The tox setup has the following environments: black, py36, py27, doctest,
py36-regression, py27-regression, py36-fuzz, py27-fuzz, pylint, pycodestyle,
pydocstyle, flake8, doc8, badges, docs, & dist. So if you only want to generate
documentation (in HTML, EPUB, & PDF formats), just call::

tox -e docs

Expand All @@ -304,4 +317,6 @@ In order to only run & generate Flake8 reports, call::
tox -e flake8

Contributions such as bug reports, PRs, suggestions, desired new features, etc.
are welcome through the Github Issues & Pull requests.
are welcome through Github
`Issues <https://github.com/chrislit/abydos/issues>`_ &
`Pull requests <https://github.com/chrislit/abydos/pulls>`_.
30 changes: 29 additions & 1 deletion abydos/__init__.py
Expand Up @@ -19,8 +19,36 @@
"""abydos.
Abydos NLP/IR library by Christopher C. Little
There are nine major packages that make up Abydos:
- :py:mod:`.compression` for string compression classes
- :py:mod:`.corpus` for document corpus classes
- :py:mod:`.distance` for string distance measure & metric classes
- :py:mod:`.fingerprint` for string fingerprint classes
- :py:mod:`.phones` for functions relating to phones and phonemes
- :py:mod:`.phonetic` for phonetic algorithm classes
- :py:mod:`.stats` for statistical functions and a confusion table class
- :py:mod:`.stemmer` for stemming classes
- :py:mod:`.tokenizer` for tokenizer classes
Classes with each package have consistent method names, as discussed below.
A tenth package, :py:mod:`.util`, contains functions not intended for end-user
use.
----
"""
__version__ = '0.3.5'

from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)

__version__ = '0.3.6'

__all__ = [
'compression',
Expand Down
43 changes: 32 additions & 11 deletions abydos/compression/__init__.py
Expand Up @@ -16,30 +16,51 @@
# You should have received a copy of the GNU General Public License
# along with Abydos. If not, see <http://www.gnu.org/licenses/>.

"""abydos.compression.
r"""abydos.compression.
The compression package defines compression and compression-related functions
for use within Abydos, including implementations of the following:
- arithmetic coding functions (ac_train, ac_encode, & ac_decode)
- Burrows-Wheeler transform encoder/decoder (bwt_encode & bwt_decode)
- Run-Length Encoding encoder/decoder (rle_encode & rle_decode)
- :py:class:`.Arithmetic` for arithmetic coding
- :py:class:`.BWT` for Burrows-Wheeler Transform
- :py:class:`.RLE` for Run-Length Encoding
Each class exposes ``encode`` and ``decode`` methods for performing and
reversing its encoding. For example, the Burrows-Wheeler Transform can be
performed by creating a :py:class:`.BWT` object and then calling
:py:meth:`.BWT.encode` on a string:
>>> bwt = BWT()
>>> bwt.encode('^BANANA')
'ANNB^AA\x00'
----
"""

from __future__ import unicode_literals
from __future__ import (
absolute_import,
division,
print_function,
unicode_literals,
)

from ._arithmetic import ac_decode, ac_encode, ac_train
from ._bwt import bwt_decode, bwt_encode
from ._rle import rle_decode, rle_encode
from ._arithmetic import Arithmetic, ac_decode, ac_encode, ac_train
from ._bwt import BWT, bwt_decode, bwt_encode
from ._rle import RLE, rle_decode, rle_encode

__all__ = [
'Arithmetic',
'ac_decode',
'ac_encode',
'ac_train',
'BWT',
'bwt_decode',
'bwt_encode',
'RLE',
'rle_decode',
'rle_encode',
'ac_decode',
'ac_encode',
'ac_train',
]


Expand Down

0 comments on commit 71985bb

Please sign in to comment.