alif-toolkit
Origin
When I made crossword-unicode and wiki-crossword (which generates crossword puzzles from scraping random Wikipedia articles), Arabic script posed some interesting challenges. I open sourced my work, but it started me thinking about more general data and tools to make it easier to build language games for Arabic-script languages.
This module contains normalization and text-shaping options, for the first time in MIT-licensed JavaScript / TypeScript.
Setup
- npm install alif-toolkit
Usage
; // splitterslet val = ;; let val2 = ;; // normalization // this is an alif + accent which can be split into two more common charslet val3 = ;; // this is a presentation form (isolated, initial, medial, final)// by default it is replaced by the standard typed letterlet val4 = ;; // you can tell Normal not to change any presentation formslet val5 = ;; // text-shaping - individual characterslet val6 = ;; // text-shaping - words with contextlet val7 = ;; // char in any Arabic Unicode range? (normal, extended, presentation forms)if word; // parent / grandparent entry in the Unicode JSON referencelet alif = "\u0627" alifOptions = ;console;console; let alif_hamza_below_isolated = "\uFE87" alif_hamza_below = alif = ;
Examples
TODO: alif-word-bank
- Fill-in-the-blanks example
- Animals crossword example
License
Content / data largely CC-BY-SA Wikipedia, Wiktionary, and Kiwix
Code open sourced under an MIT license