All files / mutxt-react/src/translit/schemes he-translit.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64                      2x                                                                                                        
import type {TranslitScheme} from '../types';
 
/**
 * Hebrew (consonantal) translit. Final letters (ך / ם / ן / ף / ץ) handled
 * via `finalForms` on word boundaries. RTL is handled by the browser's
 * built-in bidi algorithm — the matcher just emits Unicode codepoints.
 *
 * Vowels follow Hebrew abjad conventions: short `a` and `e` are silently
 * dropped (no glyph), while long `i / o / u` map to mater lectionis
 * (י / ו / ו). To force a long alif, type `aa → א`.
 */
export const heTranslit: TranslitScheme = {
  id: 'he-translit',
  name: 'Hebrew (translit)',
  short: 'HE',
  language: 'he',
  script: 'Hebr',
  direction: 'rtl',
  kind: 'alphabet',
  rules: [
    // Digraphs (consonants + long-alif `aa → א`).
    {in: 'aa', out: 'א'},
    {in: 'ch', out: 'ח'},
    {in: 'tt', out: 'ט'},
    {in: 'sh', out: 'ש'},
    {in: 'ts', out: 'צ'},
 
    // Ayin uses the apostrophe key (Russian convention `'` → ь does not apply here).
    {in: "'", out: 'ע', caseFold: false},
 
    // Vowels: short a/e silent; long i/o/u via mater lectionis.
    {in: 'a', out: ''},
    {in: 'e', out: ''},
    {in: 'i', out: 'י'},
    {in: 'o', out: 'ו'},
    {in: 'u', out: 'ו'},
 
    // Consonants.
    {in: 'b', out: 'ב'},
    {in: 'g', out: 'ג'},
    {in: 'd', out: 'ד'},
    {in: 'h', out: 'ה'},
    {in: 'v', out: 'ו'},
    {in: 'z', out: 'ז'},
    {in: 'y', out: 'י'},
    {in: 'k', out: 'כ'},
    {in: 'l', out: 'ל'},
    {in: 'm', out: 'מ'},
    {in: 'n', out: 'נ'},
    {in: 's', out: 'ס'},
    {in: 'p', out: 'פ'},
    {in: 'q', out: 'ק'},
    {in: 'r', out: 'ר'},
    {in: 't', out: 'ת'},
  ],
  finalForms: {
    כ: 'ך',
    מ: 'ם',
    נ: 'ן',
    פ: 'ף',
    צ: 'ץ',
  },
};