shevchenko 3.1.5 → 3.2.0

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 (73) hide show
  1. package/dist/cjs/anthroponym-declension/anthroponym-inflector.js +2 -2
  2. package/dist/cjs/anthroponym-declension/bootstrap.js +2 -2
  3. package/dist/cjs/anthroponym-declension/family-name-classifier/artifacts/model.bundle.json.js +2 -2
  4. package/dist/cjs/anthroponym-declension/family-name-classifier/cache/incorrect-predictions.json.js +2 -2
  5. package/dist/cjs/anthroponym-declension/family-name-classifier/family-name-class-transformer.js +2 -2
  6. package/dist/cjs/anthroponym-declension/family-name-classifier/family-name-classifer.js +2 -2
  7. package/dist/cjs/anthroponym-declension/family-name-classifier/model-bundle-loader.js +2 -2
  8. package/dist/cjs/anthroponym-declension/family-name-classifier/model-config.js +2 -2
  9. package/dist/cjs/anthroponym-declension/family-name-classifier/word-transformer.js +2 -2
  10. package/dist/cjs/anthroponym-declension/family-name-inflector.js +2 -2
  11. package/dist/cjs/anthroponym-declension/given-name-inflector.js +2 -2
  12. package/dist/cjs/anthroponym-declension/name-inflector.js +2 -2
  13. package/dist/cjs/anthroponym-declension/patronymic-name-inflector.js +2 -2
  14. package/dist/cjs/extension.js +2 -2
  15. package/dist/cjs/gender-detection/artifacts/given-name-rules.json.js +2 -2
  16. package/dist/cjs/gender-detection/artifacts/patronymic-name-rules.json.js +2 -2
  17. package/dist/cjs/gender-detection/detect-gender.js +2 -2
  18. package/dist/cjs/gender-detection/grammatical-gender-detector.js +2 -2
  19. package/dist/cjs/index.js +2 -2
  20. package/dist/cjs/input-validation.js +2 -2
  21. package/dist/cjs/language/alphabet.js +2 -2
  22. package/dist/cjs/language/grammatical-case.js +2 -2
  23. package/dist/cjs/language/grammatical-gender.js +2 -2
  24. package/dist/cjs/language/letter-case.js +2 -2
  25. package/dist/cjs/language/linguistics.js +2 -2
  26. package/dist/cjs/language/word-class.js +2 -2
  27. package/dist/cjs/shevchenko.js +2 -2
  28. package/dist/cjs/word-declension/append-command-runner.js +2 -2
  29. package/dist/cjs/word-declension/bootstrap.js +2 -2
  30. package/dist/cjs/word-declension/command-runner-factory.js +2 -2
  31. package/dist/cjs/word-declension/declension-rule-inflector.js +2 -2
  32. package/dist/cjs/word-declension/declension-types.js +2 -2
  33. package/dist/cjs/word-declension/replace-command-runner.js +2 -2
  34. package/dist/cjs/word-declension/rules/artifacts/declension-rules.json.js +7 -108
  35. package/dist/cjs/word-declension/word-inflector.js +10 -5
  36. package/dist/es/anthroponym-declension/anthroponym-inflector.js +2 -2
  37. package/dist/es/anthroponym-declension/bootstrap.js +2 -2
  38. package/dist/es/anthroponym-declension/family-name-classifier/artifacts/model.bundle.json.js +2 -2
  39. package/dist/es/anthroponym-declension/family-name-classifier/cache/incorrect-predictions.json.js +2 -2
  40. package/dist/es/anthroponym-declension/family-name-classifier/family-name-class-transformer.js +2 -2
  41. package/dist/es/anthroponym-declension/family-name-classifier/family-name-classifer.js +2 -2
  42. package/dist/es/anthroponym-declension/family-name-classifier/model-bundle-loader.js +2 -2
  43. package/dist/es/anthroponym-declension/family-name-classifier/model-config.js +2 -2
  44. package/dist/es/anthroponym-declension/family-name-classifier/word-transformer.js +2 -2
  45. package/dist/es/anthroponym-declension/family-name-inflector.js +2 -2
  46. package/dist/es/anthroponym-declension/given-name-inflector.js +2 -2
  47. package/dist/es/anthroponym-declension/name-inflector.js +2 -2
  48. package/dist/es/anthroponym-declension/patronymic-name-inflector.js +2 -2
  49. package/dist/es/extension.js +2 -2
  50. package/dist/es/gender-detection/artifacts/given-name-rules.json.js +2 -2
  51. package/dist/es/gender-detection/artifacts/patronymic-name-rules.json.js +2 -2
  52. package/dist/es/gender-detection/detect-gender.js +2 -2
  53. package/dist/es/gender-detection/grammatical-gender-detector.js +2 -2
  54. package/dist/es/index.js +2 -2
  55. package/dist/es/input-validation.js +2 -2
  56. package/dist/es/language/alphabet.js +2 -2
  57. package/dist/es/language/grammatical-case.js +2 -2
  58. package/dist/es/language/grammatical-gender.js +2 -2
  59. package/dist/es/language/letter-case.js +2 -2
  60. package/dist/es/language/linguistics.js +2 -2
  61. package/dist/es/language/word-class.js +2 -2
  62. package/dist/es/shevchenko.js +2 -2
  63. package/dist/es/word-declension/append-command-runner.js +2 -2
  64. package/dist/es/word-declension/bootstrap.js +2 -2
  65. package/dist/es/word-declension/command-runner-factory.js +2 -2
  66. package/dist/es/word-declension/declension-rule-inflector.js +2 -2
  67. package/dist/es/word-declension/declension-types.js +2 -2
  68. package/dist/es/word-declension/replace-command-runner.js +2 -2
  69. package/dist/es/word-declension/rules/artifacts/declension-rules.json.js +7 -108
  70. package/dist/es/word-declension/word-inflector.js +10 -5
  71. package/dist/es/word-declension/word-inflector.test.d.ts +1 -0
  72. package/dist/umd/shevchenko.min.js +56 -56
  73. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  class AnthroponymInflector {
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import { wordInflector } from '../word-declension/bootstrap.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  var modelInfo = {
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  var incorrectPredictionsCache = {
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import '../../language/alphabet.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import * as tf from '@tensorflow/tfjs';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import modelBundle from './artifacts/model.bundle.json.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import { AlphabetEncoding } from '../../language/alphabet.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import '../language/alphabet.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import { NameInflector } from './name-inflector.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  class NameInflector {
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import { NameInflector } from './name-inflector.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import { wordInflector } from './word-declension/bootstrap.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  var masculine = "(ин|ій|ом|ам|ян|ан|ар|рт|ас|он|ін|ен|ем|ур|ип|ьд|ей|ко|ид|ст|ир|ав|сл|ис|ой|ил|им|др|ет|уб|ор|ад|ай|юб|од|юд|ол|ло|іб|ат|ун|ум|яд|іт|ик|ог|ач|ро|уг|ік|ід|то|ус|нн|ий|до|ев|ич|ух|ць|ег|сь|ів|ап|ім|зд|ац|єр|їл|рг|яр|лк|ок|іл|ох|іш|іг|ив|ук|ек|ош|иль|вір|ула|ята|зір|ива|иня|ега|лля|ьма|ука|пір|рит|мов|ага|дір|ала|ема|вит|воля|шата|ітер|біда|кита|кола|екса|лель|рава|сила|вута|урма|дота|чара|слава)$";
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  var masculine = "[иі]ч$";
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import givenNameRules from './artifacts/given-name-rules.json.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import '../language/alphabet.js';
package/dist/es/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  export { detectGender, inAblative, inAccusative, inDative, inGenitive, inLocative, inNominative, inVocative } from './shevchenko.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import { getCustomFieldNames } from './extension.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  const VOWEL_PATTERN = /[аоуеиіяюєї]/gi;
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  /**
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import { anthroponymInflector } from './anthroponym-declension/bootstrap.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  class AppendCommandRunner {
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import declensionRules from './rules/artifacts/declension-rules.json.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import { AppendCommandRunner } from './append-command-runner.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import '../language/alphabet.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import '../language/alphabet.js';
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  class ReplaceCommandRunner {
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  var declensionRules = [
@@ -1893,109 +1893,6 @@ var declensionRules = [
1893
1893
  ]
1894
1894
  }
1895
1895
  },
1896
- {
1897
- description: "друга відміна / чоловічий рід / тверда група / на -орел",
1898
- examples: [
1899
- "орел"
1900
- ],
1901
- wordClass: "noun",
1902
- gender: [
1903
- "masculine"
1904
- ],
1905
- priority: 5,
1906
- applicationType: [
1907
- ],
1908
- pattern: {
1909
- find: "орел$",
1910
- modify: "(.{1})(.{1})$"
1911
- },
1912
- grammaticalCases: {
1913
- nominative: [
1914
- ],
1915
- genitive: [
1916
- {
1917
- "0": {
1918
- action: "replace",
1919
- value: "л"
1920
- },
1921
- "1": {
1922
- action: "replace",
1923
- value: "а"
1924
- }
1925
- }
1926
- ],
1927
- dative: [
1928
- {
1929
- "0": {
1930
- action: "replace",
1931
- value: "л"
1932
- },
1933
- "1": {
1934
- action: "replace",
1935
- value: "ові"
1936
- }
1937
- },
1938
- {
1939
- "0": {
1940
- action: "replace",
1941
- value: "л"
1942
- },
1943
- "1": {
1944
- action: "replace",
1945
- value: "у"
1946
- }
1947
- }
1948
- ],
1949
- accusative: [
1950
- {
1951
- "0": {
1952
- action: "replace",
1953
- value: "л"
1954
- },
1955
- "1": {
1956
- action: "replace",
1957
- value: "а"
1958
- }
1959
- }
1960
- ],
1961
- ablative: [
1962
- {
1963
- "0": {
1964
- action: "replace",
1965
- value: "л"
1966
- },
1967
- "1": {
1968
- action: "replace",
1969
- value: "ом"
1970
- }
1971
- }
1972
- ],
1973
- locative: [
1974
- {
1975
- "0": {
1976
- action: "replace",
1977
- value: "л"
1978
- },
1979
- "1": {
1980
- action: "replace",
1981
- value: "ові"
1982
- }
1983
- }
1984
- ],
1985
- vocative: [
1986
- {
1987
- "0": {
1988
- action: "replace",
1989
- value: "л"
1990
- },
1991
- "1": {
1992
- action: "replace",
1993
- value: "е"
1994
- }
1995
- }
1996
- ]
1997
- }
1998
- },
1999
1896
  {
2000
1897
  description: "друга відміна / чоловічий рід / тверда група / на -якір",
2001
1898
  examples: [
@@ -4945,9 +4842,11 @@ var declensionRules = [
4945
4842
  }
4946
4843
  },
4947
4844
  {
4948
- description: "друга відміна / чоловічий рід / тверда група / бусел",
4845
+ description: "друга відміна / чоловічий рід / тверда група / бусел, дятел, орел",
4949
4846
  examples: [
4950
- "бусел"
4847
+ "бусел",
4848
+ "дятел",
4849
+ "орел"
4951
4850
  ],
4952
4851
  wordClass: "noun",
4953
4852
  gender: [
@@ -4957,7 +4856,7 @@ var declensionRules = [
4957
4856
  applicationType: [
4958
4857
  ],
4959
4858
  pattern: {
4960
- find: "бусел$",
4859
+ find: "(бус|дят|ор)ел$",
4961
4860
  modify: "(.{1})(.{1})$"
4962
4861
  },
4963
4862
  grammaticalCases: {
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @file JavaScript library for declension of Ukrainian anthroponyms
3
3
  * @module shevchenko
4
- * @version 3.1.5
4
+ * @version 3.2.0
5
5
  * @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
6
6
  * @license MIT
7
- * @copyright 2017-2025 Oleksandr Tolochko <shevchenko-js@tooleks.com>
7
+ * @copyright 2017-2026 Oleksandr Tolochko <shevchenko-js@tooleks.com>
8
8
  * @see {@link git+https://github.com/tooleks/shevchenko-js.git}
9
9
  */
10
10
  import { DeclensionRuleInflector } from './declension-rule-inflector.js';
@@ -14,11 +14,16 @@ class WordInflector {
14
14
  this.declensionRules = [...declensionRules].sort((firstRule, lastRule) => lastRule.priority - firstRule.priority);
15
15
  }
16
16
  async inflect(word, params) {
17
- const [matchingRule] = await this.findMatchingRules(word, params);
17
+ // Normalize to NFC (Canonical Decomposition followed by Canonical Composition) to ensure
18
+ // Unicode characters are in a consistent form. This is critical for reliable pattern matching
19
+ // with Cyrillic characters, as some characters (e.g., 'і', 'ї') can be represented in multiple
20
+ // Unicode forms (composed vs. decomposed), which would cause regex patterns to fail.
21
+ const normalizedWord = word.normalize('NFC');
22
+ const [matchingRule] = await this.findMatchingRules(normalizedWord, params);
18
23
  if (matchingRule == null) {
19
- return word;
24
+ return normalizedWord;
20
25
  }
21
- return new DeclensionRuleInflector(matchingRule).inflect(word, params.grammaticalCase);
26
+ return new DeclensionRuleInflector(matchingRule).inflect(normalizedWord, params.grammaticalCase);
22
27
  }
23
28
  /**
24
29
  * Finds matching declension rules for the given word.
@@ -0,0 +1 @@
1
+ export {};