Special syntax
Special syntax lets you control the conversion of individual words directly in
the input text — without writing a custom config. It is honored by all three
builtin pipelines (tarask, alphabetic, phonetic).
The three controls
Section titled “The three controls”| fix (convert normally) | no fix (leave as-is) | change only alphabet | |
|---|---|---|---|
| brackets | <,Планета> |
<Планета> |
<*Планета> |
| no brackets | Планета |
<.Планета> |
<*.Планета> |
By default a word is converted, so “fix” with brackets is only needed to override a word that would otherwise be left alone. The three markers are:
<.X>/<*.X>— no fix. LeaveXuntouched (don’t convert it). With the leading*it still transliterates the alphabet but skips taraskevization.<,X>— force fix. ConvertXeven if it would normally be escaped.<*X>— alphabet only. Change only the alphabet ofX, skipping taraskevization.
Bracketed vs. unbracketed forms
Section titled “Bracketed vs. unbracketed forms”The bracketed form <…> is the most explicit and works anywhere, including
mid-word. The unbracketed form uses a leading marker character and is handy
for whole words:
import { pipelines, TaraskConfig, dicts } from "taraskevizer";
const cfg = new TaraskConfig({ abc: dicts.alphabets.latin });
pipelines.tarask("Гэта <Планета>", cfg);// "Heta <Планета>"
pipelines.tarask("плянэта <.Планета>", cfg);// "planeta Планета"
pipelines.tarask("<*Гродна>", cfg);// <Hrodna>Escaping angle brackets
Section titled “Escaping angle brackets”Inside the markers, a literal > is written as \> so it is not treated as
the marker’s closing bracket:
<тэкст з \> стрэлкай>How it works under the hood
Section titled “How it works under the hood”Marked parts are extracted before conversion and stored, then re-inserted
afterwards using the noFixPlaceholder. The steps involved are
resolveSpecialSyntax
(which captures the parts) and
applyNoFix
(which puts them back). You normally never call these directly — they run as
part of every builtin pipeline.