taraskevizer 8.0.9 → 8.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.js +2 -2
- package/dist/dict/alphabets/arabic.js +1 -1
- package/dist/dict/alphabets/index.js +3 -3
- package/dist/dict/alphabets/latin.js +2 -2
- package/dist/dict/index.d.ts +1 -1
- package/dist/dict/index.js +4 -4
- package/dist/dict/iwords.js +1 -1
- package/dist/dict/softening.js +2 -2
- package/dist/dict/wordlist.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +7 -7
- package/dist/lib/highlight-diff.js +2 -2
- package/dist/lib/index.js +8 -8
- package/dist/pipelines.d.ts +8 -8
- package/dist/pipelines.js +13 -2
- package/dist/steps/apply-g.js +2 -3
- package/dist/steps/apply-variations.js +2 -2
- package/dist/steps/convert-alphabet.js +1 -1
- package/dist/steps/finalize.js +1 -1
- package/dist/steps/highlight-diff.js +2 -2
- package/dist/steps/i-to-j.js +2 -2
- package/dist/steps/index.js +16 -16
- package/dist/steps/join-splitted.js +1 -1
- package/dist/steps/prepare.js +1 -1
- package/dist/steps/resolve-syntax.js +1 -1
- package/dist/steps/restore-case.js +1 -1
- package/dist/steps/store-splitted-abc-converted-orig.js +1 -1
- package/dist/steps/taraskevize.js +2 -2
- package/dist/steps/to-lower-case.js +1 -1
- package/dist/steps/trim.js +1 -1
- package/dist/steps/whitespaces.js +1 -1
- package/dist/tarask.d.ts +1 -1
- package/dist/tarask.js +1 -1
- package/package.json +49 -50
package/dist/config.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './cyrillic';
|
|
2
|
-
export * from './latin';
|
|
3
|
-
export * from './arabic';
|
|
1
|
+
export * from './cyrillic.js';
|
|
2
|
+
export * from './latin.js';
|
|
3
|
+
export * from './arabic.js';
|
package/dist/dict/index.d.ts
CHANGED
package/dist/dict/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './gobj';
|
|
2
|
-
export * from './wordlist';
|
|
3
|
-
export * from './softening';
|
|
4
|
-
export * as alphabets from './alphabets';
|
|
1
|
+
export * from './gobj.js';
|
|
2
|
+
export * from './wordlist.js';
|
|
3
|
+
export * from './softening.js';
|
|
4
|
+
export * as alphabets from './alphabets/index.js';
|
package/dist/dict/iwords.js
CHANGED
package/dist/dict/softening.js
CHANGED
package/dist/dict/wordlist.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { iwords } from './iwords';
|
|
2
|
-
import { dictFrom, toOneLine } from './lib';
|
|
1
|
+
import { iwords } from './iwords.js';
|
|
2
|
+
import { dictFrom, toOneLine } from './lib.js';
|
|
3
3
|
const chemicalElements1 = [
|
|
4
4
|
'сканд|ванад|рубід|род|ірыд|рэзэрфорд',
|
|
5
5
|
'стронц|бар|цэр|лютэц|самар| тор|амэрыц|кальц|кюр|дармштат|лівэрмор|натр'
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export type { HtmlOptions, NonHtmlOptions, TaraskOptions } from './types';
|
|
2
|
-
export * as dicts from './dict';
|
|
2
|
+
export * as dicts from './dict/index';
|
|
3
3
|
export * from './tarask';
|
|
4
4
|
export * from './config';
|
|
5
|
-
export * as steps from './steps';
|
|
5
|
+
export * as steps from './steps/index';
|
|
6
6
|
export * as pipelines from './pipelines';
|
|
7
|
-
export * as lib from './lib';
|
|
7
|
+
export * as lib from './lib/index';
|
|
8
8
|
export { REPLACE_J, VARIATION } from './constants';
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export * as dicts from './dict';
|
|
2
|
-
export * from './tarask';
|
|
3
|
-
export * from './config';
|
|
4
|
-
export * as steps from './steps';
|
|
5
|
-
export * as pipelines from './pipelines';
|
|
6
|
-
export * as lib from './lib';
|
|
7
|
-
export { REPLACE_J, VARIATION } from './constants';
|
|
1
|
+
export * as dicts from './dict/index.js';
|
|
2
|
+
export * from './tarask.js';
|
|
3
|
+
export * from './config.js';
|
|
4
|
+
export * as steps from './steps/index.js';
|
|
5
|
+
export * as pipelines from './pipelines.js';
|
|
6
|
+
export * as lib from './lib/index.js';
|
|
7
|
+
export { REPLACE_J, VARIATION } from './constants.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { replaceG } from './replace-g';
|
|
2
|
-
import { gobj } from '../dict';
|
|
1
|
+
import { replaceG } from './replace-g.js';
|
|
2
|
+
import { gobj } from '../dict/index.js';
|
|
3
3
|
export const highlightDiff = (text, orig, isCyrillic, highlight) => {
|
|
4
4
|
const replaceGByOpposite = replaceG(($0) => gobj[$0]);
|
|
5
5
|
for (let i = 0; i < text.length; i++) {
|
package/dist/lib/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from './after-tarask';
|
|
2
|
-
export * from './highlight-diff';
|
|
3
|
-
export * from './replace-g';
|
|
4
|
-
export * from './replace-with-dict';
|
|
5
|
-
export * from './restore-case';
|
|
6
|
-
export * from './wrappers';
|
|
7
|
-
export * from './mutating-step';
|
|
8
|
-
export { dictFrom } from './../dict/lib';
|
|
1
|
+
export * from './after-tarask.js';
|
|
2
|
+
export * from './highlight-diff.js';
|
|
3
|
+
export * from './replace-g.js';
|
|
4
|
+
export * from './replace-with-dict.js';
|
|
5
|
+
export * from './restore-case.js';
|
|
6
|
+
export * from './wrappers.js';
|
|
7
|
+
export * from './mutating-step.js';
|
|
8
|
+
export { dictFrom } from './../dict/lib.js';
|
package/dist/pipelines.d.ts
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @module
|
|
16
16
|
*/
|
|
17
|
-
import { type TaraskStep } from './steps';
|
|
17
|
+
import { type TaraskStep } from './steps/index';
|
|
18
18
|
/**
|
|
19
19
|
* Storage for the pipeline {@link abcOnly}.
|
|
20
20
|
*/
|
|
@@ -28,21 +28,21 @@ type AbcOnlyStorage = {
|
|
|
28
28
|
*
|
|
29
29
|
* To see the full list of steps, check the source code.
|
|
30
30
|
*/
|
|
31
|
-
export declare const abcOnly: (TaraskStep<import("./steps").SpecialSyntaxStorage> | TaraskStep<import("./steps").WhiteSpaceStorage> | (({ storage, cfg: { general } }: {
|
|
31
|
+
export declare const abcOnly: (TaraskStep<import("./steps/resolve-syntax").SpecialSyntaxStorage> | TaraskStep<import("./steps/whitespaces").WhiteSpaceStorage> | (({ storage, cfg: { general } }: {
|
|
32
32
|
text: string;
|
|
33
33
|
storage: AbcOnlyStorage;
|
|
34
34
|
cfg: import("./config").TaraskConfig;
|
|
35
35
|
}) => void))[];
|
|
36
36
|
/**
|
|
37
37
|
* Pipeline for taraskevizing into plain text.
|
|
38
|
-
*
|
|
39
|
-
* To see the full list of steps, check the source code.
|
|
40
38
|
*/
|
|
41
|
-
export declare const plainText: (TaraskStep<import("./steps").SplittedTextStorage> | TaraskStep<import("./steps").SpecialSyntaxStorage> | TaraskStep<import("./steps").WhiteSpaceStorage>)[];
|
|
39
|
+
export declare const plainText: (TaraskStep<import("./steps/types").SplittedTextStorage> | TaraskStep<import("./steps/resolve-syntax").SpecialSyntaxStorage> | TaraskStep<import("./steps/whitespaces").WhiteSpaceStorage>)[];
|
|
42
40
|
/**
|
|
43
41
|
* Pipeline for taraskevizing into HTML.
|
|
44
|
-
*
|
|
45
|
-
* To see the full list of steps, check the source code.
|
|
46
42
|
*/
|
|
47
|
-
export declare const html: (TaraskStep<import("./steps").SplittedTextStorage> | TaraskStep<import("./steps").SpecialSyntaxStorage> | TaraskStep<import("./steps").WhiteSpaceStorage>)[];
|
|
43
|
+
export declare const html: (TaraskStep<import("./steps/types").SplittedTextStorage> | TaraskStep<import("./steps/resolve-syntax").SpecialSyntaxStorage> | TaraskStep<import("./steps/whitespaces").WhiteSpaceStorage>)[];
|
|
44
|
+
/**
|
|
45
|
+
* Pipeline for phonetizing.
|
|
46
|
+
*/
|
|
47
|
+
export declare const phonetic: (TaraskStep<import("./steps/resolve-syntax").SpecialSyntaxStorage> | TaraskStep<import("./steps/whitespaces").WhiteSpaceStorage>)[];
|
|
48
48
|
export {};
|
package/dist/pipelines.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
import { applyVariationsHtml, applyVariationsNonHtml, applyGHtml, applyGNonHtml, highlightDiffStep, highlightDiffStepNonHtml, applyNoFix, convertAlphabet, convertAlphabetLowerCase, joinSplittedText, prepare, replaceIbyJ, resolveSpecialSyntax, restoreCaseStep, restoreWhitespaces, storeSplittedAbcConvertedOrig, storeSplittedText, taraskevize, whitespacesToSpaces, trim, finalize, toLowerCase, } from './steps';
|
|
3
|
-
import { htmlWrappers } from './lib/wrappers';
|
|
2
|
+
import { applyVariationsHtml, applyVariationsNonHtml, applyGHtml, applyGNonHtml, highlightDiffStep, highlightDiffStepNonHtml, applyNoFix, convertAlphabet, convertAlphabetLowerCase, joinSplittedText, prepare, replaceIbyJ, resolveSpecialSyntax, restoreCaseStep, restoreWhitespaces, storeSplittedAbcConvertedOrig, storeSplittedText, taraskevize, whitespacesToSpaces, trim, finalize, toLowerCase, } from './steps/index.js';
|
|
3
|
+
import { htmlWrappers } from './lib/wrappers.js';
|
|
4
4
|
const resolveSpecialSyntaxWithLAB = resolveSpecialSyntax('<');
|
|
5
5
|
const finalizeWithNewLine = finalize('\n');
|
|
6
6
|
|
|
@@ -45,3 +45,14 @@ const createPipeline = (resolveSpecialSyntax, applyG, applyVariations, finalize,
|
|
|
45
45
|
export const plainText = createPipeline(resolveSpecialSyntaxWithLAB, applyGNonHtml, applyVariationsNonHtml, finalizeWithNewLine, highlightDiffStepNonHtml);
|
|
46
46
|
|
|
47
47
|
export const html = createPipeline(resolveSpecialSyntax('<'), applyGHtml, applyVariationsHtml, finalize('<br>'), highlightDiffStep(htmlWrappers.fix));
|
|
48
|
+
|
|
49
|
+
export const phonetic = [
|
|
50
|
+
trim,
|
|
51
|
+
resolveSpecialSyntaxWithLAB,
|
|
52
|
+
prepare,
|
|
53
|
+
whitespacesToSpaces,
|
|
54
|
+
convertAlphabet,
|
|
55
|
+
restoreWhitespaces,
|
|
56
|
+
applyNoFix,
|
|
57
|
+
finalizeWithNewLine,
|
|
58
|
+
];
|
package/dist/steps/apply-g.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { replaceG, ansiColorWrappers, htmlWrappers } from '../lib';
|
|
2
|
-
import { alphabets } from '../dict';
|
|
3
|
-
import { gobj } from '../dict';
|
|
1
|
+
import { replaceG, ansiColorWrappers, htmlWrappers } from '../lib/index.js';
|
|
2
|
+
import { alphabets, gobj } from '../dict/index.js';
|
|
4
3
|
export const applyGHtml = (options) => {
|
|
5
4
|
const colorize = htmlWrappers.letterH;
|
|
6
5
|
if (options.cfg.general.abc === alphabets.cyrillic)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ansiColorWrappers, mutatingStep } from '../lib';
|
|
2
|
-
import { VARIATION } from '../constants';
|
|
1
|
+
import { ansiColorWrappers, mutatingStep } from '../lib/index.js';
|
|
2
|
+
import { VARIATION } from '../constants.js';
|
|
3
3
|
|
|
4
4
|
export const applyVariableParts = (callback) => mutatingStep(({ text }) => text.replace(/\([^)]*?\)/g, ($0) => callback($0.slice(1, -1).split('|'))));
|
|
5
5
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { mutatingStep, replaceWithDict } from '../lib';
|
|
1
|
+
import { mutatingStep, replaceWithDict } from '../lib/index.js';
|
|
2
2
|
export const convertAlphabet = mutatingStep(({ text, cfg: { general: { abc: { upper, lower }, }, }, }) => replaceWithDict(replaceWithDict(text, lower), upper));
|
|
3
3
|
export const convertAlphabetLowerCase = mutatingStep(({ text, cfg: { general: { abc: { lower }, }, }, }) => replaceWithDict(text, lower));
|
package/dist/steps/finalize.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { highlightDiff, ansiColorWrappers } from '../lib';
|
|
2
|
-
import { alphabets } from '../dict';
|
|
1
|
+
import { highlightDiff, ansiColorWrappers } from '../lib/index.js';
|
|
2
|
+
import { alphabets } from '../dict/index.js';
|
|
3
3
|
|
|
4
4
|
export const highlightDiffStep = (highlight) => ({ cfg: { general: { abc }, }, storage: { textArr, origArr }, }) => {
|
|
5
5
|
highlightDiff(textArr, origArr, abc === alphabets.cyrillic, highlight);
|
package/dist/steps/i-to-j.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { alphabets } from '../dict';
|
|
2
|
-
import { REPLACE_J } from '../constants';
|
|
1
|
+
import { alphabets } from '../dict/index.js';
|
|
2
|
+
import { REPLACE_J } from '../constants.js';
|
|
3
3
|
const toJ = (shortU) => 'й ' + (shortU ? 'у' : '');
|
|
4
4
|
export const replaceIbyJ = (options) => {
|
|
5
5
|
const { abc, j } = options.cfg.general;
|
package/dist/steps/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
|
|
2
|
-
export * from './convert-alphabet';
|
|
3
|
-
export * from './highlight-diff';
|
|
4
|
-
export * from './i-to-j';
|
|
5
|
-
export * from './join-splitted';
|
|
6
|
-
export * from './apply-g';
|
|
7
|
-
export * from './apply-variations';
|
|
8
|
-
export * from './prepare';
|
|
9
|
-
export * from './resolve-syntax';
|
|
10
|
-
export * from './restore-case';
|
|
11
|
-
export * from './store-splitted-abc-converted-orig';
|
|
12
|
-
export * from './store-splitted-text';
|
|
13
|
-
export * from './taraskevize';
|
|
14
|
-
export * from './whitespaces';
|
|
15
|
-
export * from './trim';
|
|
16
|
-
export * from './finalize';
|
|
17
|
-
export * from './to-lower-case';
|
|
2
|
+
export * from './convert-alphabet.js';
|
|
3
|
+
export * from './highlight-diff.js';
|
|
4
|
+
export * from './i-to-j.js';
|
|
5
|
+
export * from './join-splitted.js';
|
|
6
|
+
export * from './apply-g.js';
|
|
7
|
+
export * from './apply-variations.js';
|
|
8
|
+
export * from './prepare.js';
|
|
9
|
+
export * from './resolve-syntax.js';
|
|
10
|
+
export * from './restore-case.js';
|
|
11
|
+
export * from './store-splitted-abc-converted-orig.js';
|
|
12
|
+
export * from './store-splitted-text.js';
|
|
13
|
+
export * from './taraskevize.js';
|
|
14
|
+
export * from './whitespaces.js';
|
|
15
|
+
export * from './trim.js';
|
|
16
|
+
export * from './finalize.js';
|
|
17
|
+
export * from './to-lower-case.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { mutatingStep } from '../lib';
|
|
1
|
+
import { mutatingStep } from '../lib/index.js';
|
|
2
2
|
export const joinSplittedText = mutatingStep(({ storage: { textArr } }) => textArr.join(' '));
|
package/dist/steps/prepare.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { replaceWithDict } from '../lib';
|
|
1
|
+
import { replaceWithDict } from '../lib/index.js';
|
|
2
2
|
export const storeSplittedAbcConvertedOrig = ({ cfg: { general: { abc: { lower, upper }, }, }, text, storage, }) => {
|
|
3
3
|
storage.origArr = replaceWithDict(replaceWithDict(text, lower), upper).split(' ');
|
|
4
4
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { noSoften, softeners, wordlist } from '../dict';
|
|
2
|
-
import { afterTarask, mutatingStep, replaceWithDict } from '../lib';
|
|
1
|
+
import { noSoften, softeners, wordlist } from '../dict/index.js';
|
|
2
|
+
import { afterTarask, mutatingStep, replaceWithDict } from '../lib/index.js';
|
|
3
3
|
const wordlistPlusNoSoften = wordlist.concat(noSoften);
|
|
4
4
|
export const taraskevize = mutatingStep(({ text }) => {
|
|
5
5
|
text = replaceWithDict(text, wordlistPlusNoSoften);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { mutatingStep } from '../lib';
|
|
1
|
+
import { mutatingStep } from '../lib/index.js';
|
|
2
2
|
export const toLowerCase = mutatingStep(({ text }) => text.toLowerCase());
|
package/dist/steps/trim.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { mutatingStep } from '../lib';
|
|
1
|
+
import { mutatingStep } from '../lib/index.js';
|
|
2
2
|
export const trim = mutatingStep(({ text }) => ` ${text.trim()} `);
|
package/dist/tarask.d.ts
CHANGED
package/dist/tarask.js
CHANGED
package/package.json
CHANGED
|
@@ -1,52 +1,51 @@
|
|
|
1
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
|
-
"types": "dist/index.d.ts"
|
|
2
|
+
"name": "taraskevizer",
|
|
3
|
+
"version": "8.0.11",
|
|
4
|
+
"author": "GooseOb",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/GooseOb/taraskevizer.git"
|
|
8
|
+
},
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "dist/index.js",
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@digitak/esrun": "^3.2.26",
|
|
13
|
+
"@types/node": "^20.12.7",
|
|
14
|
+
"bun-types": "^1.1.4",
|
|
15
|
+
"husky": "^9.0.11",
|
|
16
|
+
"prettier": "^3.2.5",
|
|
17
|
+
"tsup": "^8.0.2",
|
|
18
|
+
"typedoc": "^0.25.13",
|
|
19
|
+
"typescript": "^5.4.5"
|
|
20
|
+
},
|
|
21
|
+
"bin": {
|
|
22
|
+
"tarask": "dist/bin.js"
|
|
23
|
+
},
|
|
24
|
+
"description": "Канвэртацыя акадэмічнага правапісу ў клясычны",
|
|
25
|
+
"files": [
|
|
26
|
+
"dist",
|
|
27
|
+
"README.md"
|
|
28
|
+
],
|
|
29
|
+
"homepage": "https://gooseob.github.io/taraskevizatar/",
|
|
30
|
+
"keywords": [
|
|
31
|
+
"taraskevizatar",
|
|
32
|
+
"taraskevica",
|
|
33
|
+
"тарашкевіца",
|
|
34
|
+
"тарашкевізатар",
|
|
35
|
+
"belarusian"
|
|
36
|
+
],
|
|
37
|
+
"license": "MIT",
|
|
38
|
+
"private": false,
|
|
39
|
+
"scripts": {
|
|
40
|
+
"build": "tsc --project src/tsconfig.json && bun ./afterbuild.js",
|
|
41
|
+
"dev": "esrun --watch=src/*,test/*,bin/* --send-code-mode=temporaryFile test",
|
|
42
|
+
"dev:bun": "bun ./test/bun-watch.ts",
|
|
43
|
+
"dev-bun": "bun test --watch",
|
|
44
|
+
"test": "esrun --send-code-mode=temporaryFile test",
|
|
45
|
+
"test-cli": "bun run build && esrun --send-code-mode=temporaryFile test",
|
|
46
|
+
"docs": "typedoc"
|
|
47
|
+
},
|
|
48
|
+
"sideEffects": false,
|
|
49
|
+
"type": "module",
|
|
50
|
+
"types": "dist/index.d.ts"
|
|
52
51
|
}
|