shevchenko 3.2.1 → 3.2.3

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.
Files changed (74) hide show
  1. package/dist/cjs/anthroponym-declension/anthroponym-inflector.js +1 -1
  2. package/dist/cjs/anthroponym-declension/bootstrap.js +1 -1
  3. package/dist/cjs/anthroponym-declension/family-name-classifier/artifacts/model.bundle.json.js +1 -1
  4. package/dist/cjs/anthroponym-declension/family-name-classifier/cache/incorrect-predictions.json.js +1 -1
  5. package/dist/cjs/anthroponym-declension/family-name-classifier/family-name-class-transformer.js +1 -1
  6. package/dist/cjs/anthroponym-declension/family-name-classifier/family-name-classifer.js +1 -1
  7. package/dist/cjs/anthroponym-declension/family-name-classifier/model-bundle-loader.js +1 -1
  8. package/dist/cjs/anthroponym-declension/family-name-classifier/model-config.js +1 -1
  9. package/dist/cjs/anthroponym-declension/family-name-classifier/word-transformer.js +1 -1
  10. package/dist/cjs/anthroponym-declension/family-name-inflector.js +1 -1
  11. package/dist/cjs/anthroponym-declension/given-name-inflector.js +1 -1
  12. package/dist/cjs/anthroponym-declension/name-inflector.js +1 -1
  13. package/dist/cjs/anthroponym-declension/patronymic-name-inflector.js +1 -1
  14. package/dist/cjs/extension.js +1 -1
  15. package/dist/cjs/gender-detection/artifacts/given-name-rules.json.js +1 -1
  16. package/dist/cjs/gender-detection/artifacts/patronymic-name-rules.json.js +1 -1
  17. package/dist/cjs/gender-detection/detect-gender.js +1 -1
  18. package/dist/cjs/gender-detection/grammatical-gender-detector.js +1 -1
  19. package/dist/cjs/index.js +1 -1
  20. package/dist/cjs/input-validation.js +33 -5
  21. package/dist/cjs/language/alphabet.js +1 -1
  22. package/dist/cjs/language/grammatical-case.js +1 -1
  23. package/dist/cjs/language/grammatical-gender.js +1 -1
  24. package/dist/cjs/language/letter-case.js +1 -1
  25. package/dist/cjs/language/linguistics.js +1 -1
  26. package/dist/cjs/language/word-class.js +1 -1
  27. package/dist/cjs/shevchenko.js +6 -6
  28. package/dist/cjs/word-declension/append-command-runner.js +1 -1
  29. package/dist/cjs/word-declension/bootstrap.js +1 -1
  30. package/dist/cjs/word-declension/command-runner-factory.js +1 -1
  31. package/dist/cjs/word-declension/declension-rule-inflector.js +1 -1
  32. package/dist/cjs/word-declension/declension-types.js +1 -1
  33. package/dist/cjs/word-declension/replace-command-runner.js +1 -1
  34. package/dist/cjs/word-declension/rules/artifacts/declension-rules.json.js +5 -3
  35. package/dist/cjs/word-declension/word-inflector.js +4 -9
  36. package/dist/es/anthroponym-declension/anthroponym-inflector.js +1 -1
  37. package/dist/es/anthroponym-declension/bootstrap.js +1 -1
  38. package/dist/es/anthroponym-declension/family-name-classifier/artifacts/model.bundle.json.js +1 -1
  39. package/dist/es/anthroponym-declension/family-name-classifier/cache/incorrect-predictions.json.js +1 -1
  40. package/dist/es/anthroponym-declension/family-name-classifier/family-name-class-transformer.js +1 -1
  41. package/dist/es/anthroponym-declension/family-name-classifier/family-name-classifer.js +1 -1
  42. package/dist/es/anthroponym-declension/family-name-classifier/model-bundle-loader.js +1 -1
  43. package/dist/es/anthroponym-declension/family-name-classifier/model-config.js +1 -1
  44. package/dist/es/anthroponym-declension/family-name-classifier/word-transformer.js +1 -1
  45. package/dist/es/anthroponym-declension/family-name-inflector.js +1 -1
  46. package/dist/es/anthroponym-declension/given-name-inflector.js +1 -1
  47. package/dist/es/anthroponym-declension/name-inflector.js +1 -1
  48. package/dist/es/anthroponym-declension/patronymic-name-inflector.js +1 -1
  49. package/dist/es/extension.js +1 -1
  50. package/dist/es/gender-detection/artifacts/given-name-rules.json.js +1 -1
  51. package/dist/es/gender-detection/artifacts/patronymic-name-rules.json.js +1 -1
  52. package/dist/es/gender-detection/detect-gender.js +1 -1
  53. package/dist/es/gender-detection/grammatical-gender-detector.js +1 -1
  54. package/dist/es/index.js +1 -1
  55. package/dist/es/input-validation.d.ts +18 -6
  56. package/dist/es/input-validation.js +33 -5
  57. package/dist/es/language/alphabet.js +1 -1
  58. package/dist/es/language/grammatical-case.js +1 -1
  59. package/dist/es/language/grammatical-gender.js +1 -1
  60. package/dist/es/language/letter-case.js +1 -1
  61. package/dist/es/language/linguistics.js +1 -1
  62. package/dist/es/language/word-class.js +1 -1
  63. package/dist/es/shevchenko.js +6 -6
  64. package/dist/es/word-declension/append-command-runner.js +1 -1
  65. package/dist/es/word-declension/bootstrap.js +1 -1
  66. package/dist/es/word-declension/command-runner-factory.js +1 -1
  67. package/dist/es/word-declension/declension-rule-inflector.js +1 -1
  68. package/dist/es/word-declension/declension-types.js +1 -1
  69. package/dist/es/word-declension/replace-command-runner.js +1 -1
  70. package/dist/es/word-declension/rules/artifacts/declension-rules.json.js +5 -3
  71. package/dist/es/word-declension/word-inflector.js +4 -9
  72. package/dist/umd/shevchenko.min.js +4 -4
  73. package/package.json +2 -1
  74. package/dist/es/word-declension/word-inflector.test.d.ts +0 -1
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
package/dist/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -19,9 +19,15 @@ class InputValidationError extends TypeError {
19
19
  }
20
20
  const fieldNames = ['givenName', 'patronymicName', 'familyName'];
21
21
  /**
22
- * Validates if a given value is a valid input for declension.
22
+ * Validates and normalizes declension input.
23
23
  *
24
- * @throws {InputValidationError}
24
+ * Validates that the input is a valid declension input object and normalizes all string fields
25
+ * to NFC (Canonical Decomposition followed by Canonical Composition) form to ensure Unicode
26
+ * characters are in a consistent form for reliable pattern matching with Cyrillic characters.
27
+ *
28
+ * @param input - The input to validate and normalize
29
+ * @returns A new validated and normalized input object
30
+ * @throws {InputValidationError} If validation fails
25
31
  */
26
32
  function validateDeclensionInput(input) {
27
33
  if (!isObject(input)) {
@@ -42,11 +48,25 @@ function validateDeclensionInput(input) {
42
48
  throw new InputValidationError(`The "${fieldName}" parameter must be a string.`);
43
49
  }
44
50
  }
51
+ const validInput = Object.assign({}, input);
52
+ for (const fieldName of mergedFieldNames) {
53
+ const fieldValue = validInput[fieldName];
54
+ if (typeof fieldValue === 'string') {
55
+ validInput[fieldName] = fieldValue.normalize('NFC');
56
+ }
57
+ }
58
+ return validInput;
45
59
  }
46
60
  /**
47
- * Validates if a given value is a valid input for gender detection.
61
+ * Validates and normalizes gender detection input.
48
62
  *
49
- * @throws {InputValidationError}
63
+ * Validates that the input is a valid gender detection input object and normalizes all string
64
+ * fields to NFC (Canonical Decomposition followed by Canonical Composition) form to ensure
65
+ * Unicode characters are in a consistent form for reliable pattern matching with Cyrillic characters.
66
+ *
67
+ * @param input - The input to validate and normalize
68
+ * @returns A new validated and normalized input object
69
+ * @throws {InputValidationError} If validation fails
50
70
  */
51
71
  function validateGenderDetectionInput(input) {
52
72
  if (!isObject(input)) {
@@ -61,6 +81,14 @@ function validateGenderDetectionInput(input) {
61
81
  throw new InputValidationError(`The "${fieldName}" parameter must be a string.`);
62
82
  }
63
83
  }
84
+ const validInput = Object.assign({}, input);
85
+ for (const fieldName of fieldNames) {
86
+ const fieldValue = validInput[fieldName];
87
+ if (typeof fieldValue === 'string') {
88
+ validInput[fieldName] = fieldValue.normalize('NFC');
89
+ }
90
+ }
91
+ return validInput;
64
92
  }
65
93
  function isObject(value) {
66
94
  return typeof value === 'object' && value != null;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -25,9 +25,9 @@ require('./word-declension/declension-types.js');
25
25
  * @throws {InputValidationError} Input validation error.
26
26
  */
27
27
  async function inGrammaticalCase(grammaticalCase, input) {
28
- inputValidation.validateDeclensionInput(input);
29
- const output = await bootstrap.anthroponymInflector.inflect(input, input.gender, grammaticalCase);
30
- const afterOutput = await extension.afterInflect(grammaticalCase, input);
28
+ const validInput = inputValidation.validateDeclensionInput(input);
29
+ const output = await bootstrap.anthroponymInflector.inflect(validInput, validInput.gender, grammaticalCase);
30
+ const afterOutput = await extension.afterInflect(grammaticalCase, validInput);
31
31
  return Object.assign(Object.assign({}, output), afterOutput);
32
32
  }
33
33
  /**
@@ -164,8 +164,8 @@ async function inVocative(input) {
164
164
  * @throws {InputValidationError} Input validation error.
165
165
  */
166
166
  async function detectGender(input) {
167
- inputValidation.validateGenderDetectionInput(input);
168
- return detectGender$1.detectGender(input);
167
+ const validInput = inputValidation.validateGenderDetectionInput(input);
168
+ return detectGender$1.detectGender(validInput);
169
169
  }
170
170
 
171
171
  exports.registerExtension = extension.registerExtension;
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -4535,11 +4535,13 @@ var declensionRules = [
4535
4535
  }
4536
4536
  },
4537
4537
  {
4538
- description: "друга відміна / чоловічий рід / м'яка група / на -окар, -екар, -етар, -зар, -ухар",
4538
+ description: "друга відміна / чоловічий рід / м'яка група / на -окар, -екар, лікар, -етар, слюсар, -зар, -ухар",
4539
4539
  examples: [
4540
4540
  "токар",
4541
4541
  "пекар",
4542
+ "лікар",
4542
4543
  "решетар",
4544
+ "слюсар",
4543
4545
  "кожухар",
4544
4546
  "кобзар"
4545
4547
  ],
@@ -4551,7 +4553,7 @@ var declensionRules = [
4551
4553
  applicationType: [
4552
4554
  ],
4553
4555
  pattern: {
4554
- find: "(окар|екар|етар|([бвгґджзйклмнпрстфхцчшщ]|дз|дж)зар|ухар)(?<!гузар)$",
4556
+ find: "(окар|екар|лікар|етар|слюсар|([бвгґджзйклмнпрстфхцчшщ]|дз|дж)зар|ухар)(?<!гузар)$",
4555
4557
  modify: "(.{1})$"
4556
4558
  },
4557
4559
  grammaticalCases: {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -16,16 +16,11 @@ class WordInflector {
16
16
  this.declensionRules = [...declensionRules].sort((firstRule, lastRule) => lastRule.priority - firstRule.priority);
17
17
  }
18
18
  async inflect(word, params) {
19
- // Normalize to NFC (Canonical Decomposition followed by Canonical Composition) to ensure
20
- // Unicode characters are in a consistent form. This is critical for reliable pattern matching
21
- // with Cyrillic characters, as some characters (e.g., 'і', 'ї') can be represented in multiple
22
- // Unicode forms (composed vs. decomposed), which would cause regex patterns to fail.
23
- const normalizedWord = word.normalize('NFC');
24
- const [matchingRule] = await this.findMatchingRules(normalizedWord, params);
19
+ const [matchingRule] = await this.findMatchingRules(word, params);
25
20
  if (matchingRule == null) {
26
- return normalizedWord;
21
+ return word;
27
22
  }
28
- return new declensionRuleInflector.DeclensionRuleInflector(matchingRule).inflect(normalizedWord, params.grammaticalCase);
23
+ return new declensionRuleInflector.DeclensionRuleInflector(matchingRule).inflect(word, params.grammaticalCase);
29
24
  }
30
25
  /**
31
26
  * Finds matching declension rules for the given word.
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.2.1
4
+ * @version 3.2.3
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
7
  * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>