~linuxgoose/linguistics-robin

b33e6742e40a94dc6a428238c8e7e66180166a5d — Jordan 8 months ago 63915e4 + ba110fe
Merge branch 'master' into 7-soundex-incorrect-calculation
R LICENSE.rst => LICENSE.md +0 -0
M README.md => README.md +7 -11
@@ 1,6 1,6 @@
# Pyphonetics
# Linguistics Robin

Pyphonetics is a Python 3 library for phonetic algorithms. Right now, the following algorithms are implemented and supported:
Linguistics Robin is a Python linguistics collection that stemmed from a phonetics only library (which is why there is currently more phonetic tooling). Right now, the following algorithms are implemented and supported:

 * Soundex
 * Metaphone


@@ 18,13 18,13 @@ More will be added in the future.

## Instalation

The module is available in PyPI, just use `pip install pyphonetics`.
The module is available in PyPI, just use `pip install linguistics-robin`.


## Usage

```python
>>> from pyphonetics import Soundex
>>> from linguistics_robin import Soundex
>>> soundex = Soundex()
>>> soundex.phonetics('Rupert')
'R163'


@@ 37,7 37,7 @@ True
The same API applies to every algorithm, e.g:

```python
>>> from pyphonetics import Metaphone
>>> from linguistics_robin import Metaphone
>>> metaphone = Metaphone()
>>> metaphone.phonetics('discrimination')
'TSKRMNXN'


@@ 46,14 46,10 @@ The same API applies to every algorithm, e.g:
You can also use the `distance(word1, word2, metric='levenshtein')` method to find the distance between 2 phonetic representations.

```python
>>> from pyphonetics import RefinedSoundex
>>> from linguistics_robin import RefinedSoundex
>>> rs = RefinedSoundex()
>>> rs.distance('Rupert', 'Robert')
0
>>> rs.distance('assign', 'assist', metric='hamming')
2
```

## Credits

The module was largely based on the implementation of phonetic algorithms found in the [Talisman.js](https://github.com/Yomguithereal/talisman) Node NLP library.
\ No newline at end of file
```
\ No newline at end of file

D README.rst => README.rst +0 -54
@@ 1,54 0,0 @@
===========
Pyphonetics
===========

Pyphonetics is a Python 3 library for phonetic algorithms. Right now, the following algorithms are implemented and supported:

 * Soundex
 * Metaphone
 * Refined Soundex
 * Fuzzy Soundex
 * Lein
 * Matching Rating Approach

More will be added in the future.

Instalation
***********

The module is available in PyPI, just use `pip install pyphonetics`.


Usage
*****

    >>> from pyphonetics import Soundex
    >>> soundex = Soundex()
    >>> soundex.phonetics('Rupert')
    'R163'
    >>> soundex.phonetics('Robert')
    'R163'
    >>> soundex.sounds_like('Robert', 'Rupert')
    True


The same API applies to every algorithm, e.g:

    >>> from pyphonetics import Metaphone
    >>> metaphone = Metaphone()
    >>> metaphone.phonetics('discrimination')
    'TSKRMNXN'

You can also use the `distance(word1, word2, metric='levenshtein')` method to find the distance between 2 phonetic representations.

    >>> from pyphonetics import RefinedSoundex
    >>> rs = RefinedSoundex()
    >>> rs.distance('Rupert', 'Robert')
    0
    >>> rs.distance('assign', 'assist', metric='hamming')
    2

Credits
=======

The module was largely based on the implementation of phonetic algorithms found in the Talisman.js (https://github.com/Yomguithereal/talisman) Node NLP library.
\ No newline at end of file

R pyphonetics/__init__.py => linguistics_robin/__init__.py +0 -0
R pyphonetics/distance_metrics/__init__.py => linguistics_robin/distance_metrics/__init__.py +0 -0
R pyphonetics/distance_metrics/hamming.py => linguistics_robin/distance_metrics/hamming.py +0 -0
R pyphonetics/distance_metrics/levenshtein.py => linguistics_robin/distance_metrics/levenshtein.py +0 -0
R pyphonetics/exceptions.py => linguistics_robin/exceptions.py +0 -0
R pyphonetics/phonetics/__init__.py => linguistics_robin/phonetics/__init__.py +0 -0
R pyphonetics/phonetics/fuzzy_soundex.py => linguistics_robin/phonetics/fuzzy_soundex.py +0 -0
R pyphonetics/phonetics/lein.py => linguistics_robin/phonetics/lein.py +0 -0
R pyphonetics/phonetics/metaphone.py => linguistics_robin/phonetics/metaphone.py +0 -0
R pyphonetics/phonetics/mra.py => linguistics_robin/phonetics/mra.py +0 -0
R pyphonetics/phonetics/phonetic_algorithm.py => linguistics_robin/phonetics/phonetic_algorithm.py +0 -0
R pyphonetics/phonetics/refined_soundex.py => linguistics_robin/phonetics/refined_soundex.py +0 -0
R pyphonetics/phonetics/soundex.py => linguistics_robin/phonetics/soundex.py +0 -0
R pyphonetics/utils.py => linguistics_robin/utils.py +0 -0
M pyproject.toml => pyproject.toml +4 -4
@@ 7,10 7,10 @@ requires = [
build-backend = "flit_core.buildapi"

[tool.flit.metadata]
module = "pyphonetics"
author = "Lilykos"
author-email = "ilias.koutsakis@gmail.com"
home-page = "https://github.com/Lilykos/pyphonetics"
module = "linguistics_robin"
author = "Jordan Robinson"
author-email = "hello@jordanrobinson.org"
home-page = "https://github.com/linuxgoose/linguistics-robin"
description-file="README.rst"
classifiers = [
    "License :: OSI Approved :: MIT License",

M tests/test_corner_cases.py => tests/test_corner_cases.py +2 -2
@@ 1,6 1,6 @@
import pytest
from pyphonetics import Soundex, RefinedSoundex, FuzzySoundex
from pyphonetics.exceptions import EmptyStringError
from linguistics_robin import Soundex, RefinedSoundex, FuzzySoundex
from linguistics_robin.exceptions import EmptyStringError


def test_soundex():

M tests/test_distances.py => tests/test_distances.py +1 -1
@@ 1,4 1,4 @@
from pyphonetics.distance_metrics import levenshtein_distance, hamming_distance
from linguistics_robin.distance_metrics import levenshtein_distance, hamming_distance


def test_levenshtein():

M tests/test_phonetics.py => tests/test_phonetics.py +1 -1
@@ 1,4 1,4 @@
from pyphonetics import Metaphone, Soundex, MatchingRatingApproach,\
from linguistics_robin import Metaphone, Soundex, MatchingRatingApproach,\
    FuzzySoundex, Lein, RefinedSoundex



M tests/test_utils.py => tests/test_utils.py +1 -1
@@ 1,4 1,4 @@
from pyphonetics.utils import squeeze, translation
from linguistics_robin.utils import squeeze, translation


def test_squeeze():