semvec/pypi-packages huggingface dataset:
sbl2py 0.1.0-2
A Snowball-to-Python compiler
License: MIT
Keywords: snowball compiler

sbl2py - A Snowball-to-Python Compiler
######################################
*sbl2py* translates code written in the Snowball_ string processing
language into Python_::

    import sbl2py
    import sbl2py.utils

    sbl_code = """
    externals ( stem )
    define stem as (
        backwards ( ['ly'] delete )
    )
    """
    py_code = sbl2py.translate_string(sbl_code)
    module = sbl2py.utils.module_from_code('demo_module', py_code)
    print module.stem('fabulously')

Output::

    fabulous

.. _Snowball: http://snowball.tartarus.org/compiler/snowman.html
.. _Python: https://www.python.org


Features
========
*sbl2py* should support all of the Snowball features that are commonly
used. In particular, all features used by the stemming algorithms from
the Snowball stemmer package are supported.


Installation
============
Installing *sbl2py* is easy using pip_::

    pip install sbl2py

.. _pip: http://pip.readthedocs.org/en/latest/index.html


Usage
=====
The easiest way to translate a Snowball file into a Python module is
using the ``sbl2py`` script which is automatically installed with
*sbl2py*::

    sbl2py SNOWBALL_FILE PYTHON_FILE

See ``sbl2py --help`` for the available options.

You can also use *sbl2py* from within Python. The ``sbl2py`` module
offers two functions that translate Snowball code from a string
(``translate_string``) or a file (``translate_file``) and return the
corresponding Python source as a string. If you want to execute the
code, simply use the ``module_from_code`` function of the
``sbl2py.utils`` module.

The generated Python modules export all routines from the original
Snowball code that are listed in the ``externals`` section. That is,
if you have ``externals ( stem )`` in your Snowball code and store
the generated Python module in a file called ``mystemmer.py`` then
you can call the ``stem`` routine as follows::

    import mystemmer
    print mystemmer.stem('foobar')

License
=======
*sbl2py* is covered by the `MIT License`_. The Snowball source code
and the word lists in the ``test`` directory are covered by the
`BSD-3 License`_. Please see the ``LICENSE`` file for details.

.. _`MIT License`: http://opensource.org/licenses/MIT
.. _`BSD-3 License`: http://opensource.org/licenses/BSD-3-Clause
acor 1.1.1
Estimate the autocorrelation time of a time series quickly.
License: MIT

ACOR
====

This is a direct port of a C++ routine by
`Jonathan Goodman <http://www.math.nyu.edu/faculty/goodman/index.html>`_ (NYU)
called `ACOR <http://www.math.nyu.edu/faculty/goodman/software/acor/>`_ that
estimates the autocorrelation time of time series data very quickly.

`Dan Foreman-Mackey <http://danfm.ca>`_ (NYU) made a few surface changes to
the interface in order to write a Python wrapper (with the permission of the
original author).

Installation
------------

Just run ::

    pip install acor

with ``sudo`` if you really need it.

Otherwise, download the source code
`as a tarball <https://github.com/dfm/acor/tarball/master>`_
or clone the git repository from `GitHub <https://github.com/dfm/acor>`_: ::

    git clone https://github.com/dfm/acor.git

Then run ::

    cd acor
    python setup.py install

to compile and install the module ``acor`` in your Python path. The only
dependency is `NumPy <http://numpy.scipy.org/>`_ (including the
``python-dev`` and ``python-numpy-dev`` packages which you might have to
install separately on some systems).

Usage
-----

Given some time series ``x``, you can estimate the autocorrelation time
(``tau``) using: ::

    import acor
    tau, mean, sigma = acor.acor(x)

References
----------

* http://www.math.nyu.edu/faculty/goodman/software/acor/index.html
* http://www.stat.unc.edu/faculty/cji/Sokal.pdf