Skip to content

Releases: avi-perl/Hebrew

`__eq__` Bug Fix

11 Dec 15:55
Compare
Choose a tag to compare

[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

11 Dec 15:40
Compare
Choose a tag to compare

[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.

image

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!

image

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.