Skip to content

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 transform
pipelines.phonetic("планета"); // experimental phonetic transform

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.

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).

Like tarask, but additionally applies phoneticization and the і/ј iotacization step. The phonetic layer is experimental and may change.

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 functions

To 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.