NYSIIS phonetic encoding algorithm.
Project description
The pynysiis package provides a Golang implementation of the New York State Identification and Intelligence System (NYSIIS) phonetic encoding algorithm. NYSIIS encodes names based on pronunciation, which is helpful in name-matching and searching applications.
Requirements
Python 2.7 and later.
Setup
You can install this package by using the pip tool and installing:
$ pip install pynysiis
Or:
$ easy_install pynysiis
Usage Example
# Basic Usage
from nysiis import NYSIIS
# Create an instance of the NYSIIS class
nysiis = NYSIIS()
# Encode a string using the NYSIIS instance
name = "Watkins"
coded_name = nysiis.encode(name)
print(coded_name) # Output: "WATCAN"
## Comparing Names
from nysiis import NYSIIS
# Create an instance of the NYSIIS class
nysiis = NYSIIS()
name1 = "John Smith"
name2 = "John Smyth"
coded_name1 = nysiis.encode(name1)
coded_name2 = nysiis.encode(name2)
if coded_name1 == coded_name2:
print("The names are likely to be the same.")
else:
print("The names are different.")
# Output:
# The names are likely to be the same.
## Handling different names
from nysiis import NYSIIS
# Create an instance of the NYSIIS class
nysiis = NYSIIS()
names = ["Watkins", "Robert Johnson", "Samantha Williams", "Olanrewaju Akinyele",
"Obinwanne Obiora", "Abdussalamu Abubakar", "Virat Kohli", "Usman Shah"]
for name in names:
coded_name = nysiis.encode(name)
print(f"Original: {name}, NYSIIS: {coded_name}")
# Output:
# Original: Watkins, NYSIIS: WATCAN
# Original: Robert Johnson, NYSIIS: RABART
# Original: Samantha Williams, NYSIIS: SANANT
# Original: Olanrewaju Akinyele, NYSIIS: OLANRA
# Original: Obinwanne Obiora, NYSIIS: OBAWAN
# Original: Abdussalamu Abubakar, NYSIIS: ABDASA
# Original: Virat Kohli, NYSIIS: VARATC
# Original: Usman Shah, NYSIIS: USNANS
Reference
@inproceedings{Rajkovic2007,
author = {Petar Rajkovic and Dragan Jankovic},
title = {Adaptation and Application of Daitch-Mokotoff Soundex Algorithm on Serbian Names},
booktitle = {XVII Conference on Applied Mathematics},
editors = {D. Herceg and H. Zarin},
pages = {193--204},
year = {2007},
publisher = {Department of Mathematics and Informatics, Novi Sad},
url = {https://jmp.sh/hukNujCG}
}
Additional References
License
This project is licensed under the MIT License.
Copyright
Copyright © 2024 Finbarrs Oketunji. All Rights Reserved.
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
pynysiis-1.0.3.tar.gz
(16.0 kB
view details)
Built Distribution
pynysiis-1.0.3-py3-none-any.whl
(14.5 kB
view details)
File details
Details for the file pynysiis-1.0.3.tar.gz
.
File metadata
- Download URL: pynysiis-1.0.3.tar.gz
- Upload date:
- Size: 16.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf13ed0874632776ed0fb5f2773792cd164007dbf5fb767b506d6039fde02327 |
|
MD5 | 30c68298ea7c89d2942209f48a8a990d |
|
BLAKE2b-256 | d63413e20c1f7f3b5f0f0425745c71657fba2b44b91ff41b59b2dbfadab88fe4 |
File details
Details for the file pynysiis-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: pynysiis-1.0.3-py3-none-any.whl
- Upload date:
- Size: 14.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.10.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4029d28b9ce2b607b82ef8289360938c8a3639591dfe0bc73497263b4f284ddc |
|
MD5 | fb2725b3d5fb9a1443771dd9af61f2c4 |
|
BLAKE2b-256 | f866003c26b7d1e2e6985505c3f73a8658c35dc45f857a8d2f3ef7413ee3464b |