A simple Python library for querying common abbreviations of English words.
Project description
word-abbr
A simple Python library for querying common abbreviations of English words.
Funtions
- Query abbreviations of words (e.g., application → app)
- Support command-line queries
- Support custom word abbreviations
- Built-in common word abbreviation mappings
- Rule-based general abbreviation algorithm
Install
pip install word-abbr
Use
CMD-LINE
word-abbr application
output: app
IN CODE
from word_abbr import get_abbr
print(get_abbr("database")) # db
eneral abbreviation algorithm
rule 1
Keep the first letter
rule 2
Starting from the second letter, do not keep vowels
rule 3
For consonants among l, m, n, and r: if the preceding letter is a vowel and the following letter is a consonant, do not keep them
rule 4
Repeat the process until the abbreviation length exceeds 4 (can also be customized), then return the result
rule 5
To be continued
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file word_abbr-0.1.1.tar.gz.
File metadata
- Download URL: word_abbr-0.1.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e475ebd821561a197646ace1ba34934fe34d4bf2056ee3531def53b2e67208d6
|
|
| MD5 |
ad0efefcd6ceda601943b978d360b473
|
|
| BLAKE2b-256 |
7de6350ec0bb092e573fbae0b544f98c2ae285e8ae80ceec6e17130b9f9d2d66
|
File details
Details for the file word_abbr-0.1.1-py3-none-any.whl.
File metadata
- Download URL: word_abbr-0.1.1-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5765cca2c01a1d0735104bbcb915a4ecb833f62ab62a7600c19d9e0e4042885b
|
|
| MD5 |
903c4c88e6e63bb46818a86fb516ae77
|
|
| BLAKE2b-256 |
66b54a7bad6174b813dc3b82544a195a24b6f19644e8964c23a4b5ee4c721f90
|