Skip to content

v2.1

Latest

Choose a tag to compare

@glot-builder glot-builder released this 06 Nov 18:12

GlotScript 2.1

Unicode 18.0.0: 178 scripts, adding Jurchen (Jurc), Pcun and Seal (Seal).

New functions

  • script_segments(text) (ss): the text cut into single-script parts, as (script, start, end, text).
  • word_scripts(text) (ws): the main script of every word.
  • script_covers(writing_system, script) and COMPOSITE_SCRIPTS: whether a writing system such as Jpan, Kore, Hans or Hant uses a script such as Hira or Hani.

Changes

  • U+FFFD (replacement character) is Zzzz only.
  • All functions share one character table; separate_script (sc) is about 30x faster with the same output.
  • python -m GlotScript.update --version X regenerates GlotScript/ranges.py from the Unicode Character Database (GlotScript's adjustments are listed in GlotScript/update.py); --check compares. UNICODE_VERSION and SCRIPT_RANGES are exported.
  • Tests in tests/test_glotscript.py.

Resource (metadata V0.2): the fas row is complete, and Wikipedia script names that have an ISO 15924 code are mapped to it.