Builtin pipelines
A pipeline is a preconfigured conversion routine. Pass text (and an
optional TaraskConfig)
to it.
| Pipeline | Taraskevization | Phonetization | Alphabet | Special syntax |
|---|---|---|---|---|
| tarask | ✅ | ❌ | ✅ | ✅ |
| alphabetic | ❌ | ❌ | ✅ | ✅ |
| phonetic | ❌ | ✅ (experimental) | ✅ | ✅ |
import { pipelines } from "taraskevizer";
pipelines.tarask("планета"); // "плянэта"pipelines.alphabetic("яна і іншыя"); // latin/alphabet-only transformpipelines.phonetic("планета"); // experimental phonetic transformWhat each pipeline does
Section titled “What each pipeline does”tarask
Section titled “tarask”The full taraskevization (classical-orthography) pipeline. It lowercases the
text, applies the alphabet conversion, replaces і after vowels
according to j, converts the alphabet, restores the original capitalization,
highlights the differences, escapes angle brackets, and finally applies
variations and wrappers. This is the one most users want.
alphabetic
Section titled “alphabetic”Changes only the alphabet — it does not taraskevize spelling. It forces
doEscapeCapitalized to false for the duration of the run, so acronyms and
all-caps fragments are converted letter-for-letter without the heuristics that
protect them in tarask. Use it when you already have text in the academic
orthography and only need the alphabet transliteration (e.g. Cyrillic ↔ Latin).
phonetic (experimental)
Section titled “phonetic (experimental)”Like tarask, but additionally applies phoneticization and the і/ј
iotacization step. The phonetic layer is experimental and may change.
How a pipeline is built
Section titled “How a pipeline is built”Internally a pipeline is just an ordered list of steps. Each step receives
a shared context ({ text, cfg, storage }) and mutates text in place. You
can inspect the steps of any builtin pipeline:
import { pipelines } from "taraskevizer";
pipelines.tarask.steps; // array of step functionsTo build on a builtin pipeline without depending on its exact internal order,
map (to replace steps) or flatMap (to add/remove steps) over
pipeline.steps and feed the result back into
pipe:
import { pipelines, lib, steps } from "taraskevizer";
const myFirstStep = steps.trim;
const myTarask = lib.pipe( pipelines.tarask.steps.map((step) => step === pipelines.tarask.steps[0] ? myFirstStep : step, ),);For full control, compose your own pipeline from the individual
steps using
lib.pipe
(synchronous) or
lib.asyncPipe
(asynchronous). See Customizing.