Skip to main content

A Python 3 linguistics collection library.

Project description

Linguistics Robin

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
  • Double-Metaphone
  • Refined Soundex
  • Fuzzy Soundex
  • Lein
  • Matching Rating Approach
  • New York State Identification and Intelligence System (NYSIIS)
  • Caverphone
  • Caverphone 2

In addition, the following distance metrics:

  • Hamming
  • Levenshtein

More will be added in the future. Please refer to the issues list for algorithms slated for the future.

Pull requests are always welcome to assist with the addition of new algorithms.

Installation

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

Usage

>>> from linguistics_robin 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 linguistics_robin 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 linguistics_robin import RefinedSoundex
>>> rs = RefinedSoundex()
>>> rs.distance('Rupert', 'Robert')
0
>>> rs.distance('assign', 'assist', metric='hamming')
2

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

linguistics_robin-0.5.9.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linguistics_robin-0.5.9-py2.py3-none-any.whl (21.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file linguistics_robin-0.5.9.tar.gz.

File metadata

  • Download URL: linguistics_robin-0.5.9.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.31.0

File hashes

Hashes for linguistics_robin-0.5.9.tar.gz
Algorithm Hash digest
SHA256 9cccc65f23ed803579a9c198bb5dc7ce59b3ea81cbca54aa5023126b634a760e
MD5 c8c51e8a044c83349b8edc811cf2941d
BLAKE2b-256 8e295f7a289f26592f7acc1925234e4abea2a8a0c6aad98aae100eecbc795e36

See more details on using hashes here.

File details

Details for the file linguistics_robin-0.5.9-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for linguistics_robin-0.5.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ac33e3d2225ace460b6295c91c12a15cabc2e9128b1fac606e4786f58fd8126b
MD5 be99f84d3fa45ecc6c46e805efb675b0
BLAKE2b-256 821703f8e302af0ab1b0387955e3ec9e8bdb312398dd71046248754b7ee616c8

See more details on using hashes here.

Supported by

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