With npm:
npm install taraskevizer
With yarn:
yarn add taraskevizer
With bun:
bun add taraskevizer
import {
tarask,
pipelines,
TaraskConfig,
htmlConfigOptions,
ansiColorWrappers,
alphabets,
REPLACE_J,
VARIATION,
} from 'taraskevizer';
tarask('планета', pipelines.tar);
// "плянэта"
const cfg = new TaraskConfig({
abc: alphabets.cyrillic,
j: 'always',
variations: 'first',
wrapperDict: ansiColorWrappers,
g: true,
});
tarask('планета і Гродна', pipelines.tar, cfg);
// "пл\x1b[32mя\x1b[0mн\x1b[32mэ\x1b[0mта \x1b[32mй\x1b[0m \x1b[35mГорадня\x1b[0m"
const htmlCfg = new TaraskConfig({
abc: alphabets.latin,
g: false,
...htmlConfigOptions,
});
tarask('энергія планеты', pipelines.tar, htmlCfg);
// "en<tarF>erg</tarF>ija p<tarF>lan</tarF>ety"
const latinWithJiCfg = new TaraskConfig({
abc: alphabets.latinJi,
});
tarask('яна і іншыя', pipelines.abcOnly, latinWithJiCfg);
// "jana j jinšyja"
Difference between the input and the output word.
<tarF>this_part_of_word_is_fixed</tarF>
пл<tarF>я</tarF>н
A part of a word wrapped in this tag is variable,
variations are mentioned in a data-l
attribute,
separated with commas.
<tarL data-l="variation2,variation3">variation1</tarL>
<tarL data-l="Горадня">Гродна</tarL>
May be toggled between г
(h
) and ґ
(g
).
Appears only if alphabet is cyrillic.
<tarH>г</tarH>
<tarH>Г</tarH>валт
fix | no fix | change only alphabet | |
---|---|---|---|
brackets | <,Планета> |
<Планета> |
<*Планета> |
no brackets | Планета |
<.Планета> |
<*.Планета> |
With npm:
npm install -g taraskevizer
With yarn:
yarn global add taraskevizer
With bun:
bun add -g taraskevizer
tarask [options] text
For usage examples and options use --help
option
(in source, content of --help
is in this file)
With npm:
npx taraskevizer [options] text
With bun:
bunx taraskevizer [options] text
Ня
should appear before a word where the first syllabe is stressed.
At the moment, there is no way to check exactly if it is stressed.
Algorithm makes some heuristics, but that's not enough to cover all cases.