ivsort.py
a simple script to sort Hebrew words with vowels and accents according to their lexical order (which differs from the unicode point order or even the locale’s collation string)
From the docstring:
Module for properly sorting Hebrew words with niqqud – according to consonants first and vowels later. If run from the command line, takes a file with a list of words as input or reads lines from stdin.
disclaimer: there is no universal method for the ordering of Hebrew vowels. The order used by this module is:
Sheva, Hataf Segol, Hataf Patah, Hataf Qamets, Hiriq, Tsere, Segol, Patah, Qamets, Holem, Holem Vav, Qibbuts, Shureq
This order may seem foreign to those accustomed to Latin-based languages, but it was recommended to me by the Academy for the Hebrew Language in Israel, and it is very similar to orders use by Unicode and standard Israeli keyboard layouts. It is also more “scientific” in the sense that it follows a phonological pattern (horizontal to vertical vowels), rather than a traditional, Latin-based pattern (aeiou).
This does differ from the one convention common in Israeli works, in that it treats Sin as a separate letter from Shin. This is not especially common in Israel, but it is the convention in all of the widely used Biblical lexicons and other Western Biblical scholarship. I do this both because it would be pedagogical malpractice to give my students glossaries that differ in this regard from the works they will be using later, and because it is more accurate from the perspective of historical linguistics.
I would probably revise this approach if this sort engine were targeted at modern Hebrew.
Usage
At the command line:
$ cat wordlist.txt | ivsort ... $ ivsort wordlist.txt
So it can read from a file or from STDIN, so as to be useful for text editors that can use shell commands as filters (like all of them that matter). It is basically how sort works.
As a Python3 module:
from ivsort import ivsort sorted_list = ivsort(unsorted_iterable)
You probably aren’t going to want to muck around with the other functions this script provides.
Metadata
Release files for ivsort 0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ivsort-0.2.tar.gz | 3.7 kB | Without provenance | Details for ivsort-0.2.tar.gz |
Release files / ivsort-0.2.tar.gz
| Download URL | ivsort-0.2.tar.gz |
|---|---|
| Size | 3.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
217220cc8a4adb284ea5c4bcd20b645e84d1eadb97fdd158ab642197f4bb0ff9
|
|
BLAKE2b-256 checksum How to use checksums |
4cbe56b338e8ce7c0e31be9482bf887df868081044bc35782bb40ecb1ea22f68
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for ivsort 0.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.