Releases: avi-perl/Hebrew
`__eq__` Bug Fix
[0.8.1] - 2023-12-11
Fixed
- Corrected an issue with subclasses of
BaseHebrewChar
where use of__eq__
would break when the type for the
comparison was not the same as itself.
What's Changed
Full Changelog: 0.8.0...0.8.1
Text Normilization
[0.8.0] - 2023-12-10
Added
-
Added
Hebrew.normalize
, a function for normalizing the hebrew characters in a string. This is typically needed with
text includes special hebrew characters.Hidden among hebrew text can be special characters that are visually identical humans, but are made up of different
unicode characters. However, this can cause issues with presentation when there is no support for these characters.
In this case, the first letter is made up of 2 unicode characters, sin with a dot
and qamatz. The issue here is the sin. By normalizing the sin with a dot to 2 unicode
characters, ש and the dot, the display
will look right!
To normalize content, use the Hebrew.normalize
function:
from hebrew import Hebrew
hs = Hebrew('שָׂחַקְתִּי כְּמוֹ')
assert len(hs.string) == 14
assert len(hs.normalize().string) == 18
Normalizing Yiddish
By default, special yiddish characters such as ײ (double Yod) are not normalized.
However, ײַ (double Yod with a Patah) will be converted to ײַ.
To fully "normalize" yiddish characters, pass True
to normalize
.