taraskevizer 9.1.6 → 9.1.7

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/bin.js CHANGED
@@ -7,7 +7,7 @@ const printWithPrefix = (msg) => {
7
7
  process.argv.splice(0, 2);
8
8
  const checkForOptions = (options) => process.argv[0] && options.includes(process.argv[0].toLowerCase());
9
9
  if (checkForOptions(['-v', '--version'])) {
10
- printWithPrefix("9.1.6");
10
+ printWithPrefix("9.1.7");
11
11
  process.exit(0);
12
12
  }
13
13
  if (checkForOptions(['-h', '--help'])) {
package/dist/config.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import type { PartialReadonly } from './types';
2
- import { Alphabet } from './dict/alphabets';
3
- import { WrapperDict } from './wrappers';
2
+ import type { Alphabet } from './dict/alphabets';
3
+ import { type WrapperDict } from './wrappers';
4
4
  export type Variation = 'no' | 'first' | 'all';
5
5
  export type OptionJ = 'never' | 'random' | 'always';
6
6
  export declare class TaraskConfig {
@@ -1,4 +1,4 @@
1
- import { OptionJ, Variation } from './config';
1
+ import type { OptionJ, Variation } from './config';
2
2
  /**
3
3
  * @deprecated since 9.1.0. Will be removed in 10.0.0
4
4
  *
@@ -1,6 +1,6 @@
1
1
  import { iwords } from './iwords.js';
2
2
  import { dictFrom, toOneLine } from './lib.js';
3
- const ia = (word, words) => ` ${word}(?= \\(?(?:[бвгджзйклмнпрстфцчшў]*[оё]|${toOneLine(words).replace(/\(/g, '(?:')}|i(?:${iwords})))`;
3
+ const ia = (word, words) => ` ${word}(?= \\(?(?:[бвгджзйклмнпрстфцчшўьʼ]*[оё]|${toOneLine(words).replace(/\(/g, '(?:')}|i(?:${iwords})))`;
4
4
  export const iaWords = dictFrom.raw([
5
5
 
6
6
  [
@@ -1,13 +1,17 @@
1
1
  const prepositionPattern = /^(?:а[бд]?|б[ея]зь?|[дз]а|д?ля|дзеля|[нп]ад?|пр[аы]|празь?|у|церазь?)$/;
2
2
  const isSingleVowel = (str) => str.match(/[аеёіоуыэюя]/g)?.length === 1;
3
+ const isFirstSyllabeStressed = (word) => /^[бвгджзйклмнпрстфцчшўьʼ]*.\u0301/.test(word);
3
4
  export const endZSoftenAndNiaBiaz = [
4
5
  [
5
6
  / бе(зь? \S+)/g,
6
- ($0, $1) => (isSingleVowel($1) ? ' бя' + $1 : $0),
7
+ ($0, $1) => isFirstSyllabeStressed($1) || isSingleVowel($1) ? ' бя' + $1 : $0,
7
8
  ],
8
9
  [
9
10
  / не (\S+)/g,
10
- ($0, $1) => isSingleVowel($1) && !prepositionPattern.test($1) ? ' ня ' + $1 : $0,
11
+ ($0, $1) => isFirstSyllabeStressed($1) ||
12
+ (isSingleVowel($1) && !prepositionPattern.test($1))
13
+ ? ' ня ' + $1
14
+ : $0,
11
15
  ],
12
16
  [/ б[ея]з(?= і\S*[ая]ў|ну )/g, ' бязь'],
13
17
  [/( (?:пра|цера)?з)(?= і\S*[ая]ў|ну )/g, (_$0, $1) => $1 + 'ь'],
@@ -1,4 +1,4 @@
1
- import { TaraskStep } from '../steps/types';
1
+ import type { TaraskStep } from '../steps/types';
2
2
  /**
3
3
  * An abstraction for a step that always changes the text.
4
4
  *
@@ -1,2 +1,2 @@
1
- import { SplittedTextStorage } from './types';
1
+ import type { SplittedTextStorage } from './types';
2
2
  export declare const joinSplittedText: import("./types").TaraskStep<SplittedTextStorage>;
@@ -1,4 +1,4 @@
1
- import { TaraskConfig } from '../config';
1
+ import type { TaraskConfig } from '../config';
2
2
  export type TaraskStep<Storage extends object = {}> = (args: {
3
3
  text: string;
4
4
  storage: Storage;
@@ -1,4 +1,4 @@
1
- import { Variation } from './config';
1
+ import type { Variation } from './config';
2
2
  type TransformString = (content: string) => string;
3
3
  export type VariationWrappers = {
4
4
  [p in Variation]: TransformString;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "taraskevizer",
3
- "version": "9.1.6",
3
+ "version": "9.1.7",
4
4
  "author": "GooseOb",
5
5
  "repository": {
6
6
  "type": "git",