shevchenko 2.1.2 → 2.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 (77) hide show
  1. package/.eslintrc.json +53 -0
  2. package/.prettierrc.json +5 -0
  3. package/dist/cjs/shevchenko.js +1307 -122
  4. package/dist/cjs/shevchenko.js.map +1 -1
  5. package/dist/es/shevchenko.js +1310 -128
  6. package/dist/es/shevchenko.js.map +1 -1
  7. package/dist/types/anthroponym-inflection/anthroponym-inflector.d.ts.map +1 -1
  8. package/dist/types/anthroponym-inflection/command-runner-factory.d.ts +1 -1
  9. package/dist/types/anthroponym-inflection/command-runner-factory.d.ts.map +1 -1
  10. package/dist/types/anthroponym-inflection/first-name-inflector.d.ts +1 -1
  11. package/dist/types/anthroponym-inflection/first-name-inflector.d.ts.map +1 -1
  12. package/dist/types/anthroponym-inflection/last-name-inflector.d.ts +1 -1
  13. package/dist/types/anthroponym-inflection/last-name-inflector.d.ts.map +1 -1
  14. package/dist/types/anthroponym-inflection/middle-name-inflector.d.ts +1 -1
  15. package/dist/types/anthroponym-inflection/middle-name-inflector.d.ts.map +1 -1
  16. package/dist/types/anthroponym-inflection/name-inflector.d.ts.map +1 -1
  17. package/dist/types/anthroponym-inflection/replace-command-runner.d.ts +1 -1
  18. package/dist/types/anthroponym-inflection/replace-command-runner.d.ts.map +1 -1
  19. package/dist/types/anthroponym-inflection/rule-inflector.d.ts.map +1 -1
  20. package/dist/types/bootstrap.d.ts.map +1 -1
  21. package/dist/types/core/validator.d.ts.map +1 -1
  22. package/dist/types/gender-detection/detect-gender.d.ts +11 -0
  23. package/dist/types/gender-detection/detect-gender.d.ts.map +1 -0
  24. package/dist/types/gender-detection/index.d.ts +2 -0
  25. package/dist/types/gender-detection/index.d.ts.map +1 -0
  26. package/dist/types/part-of-speech-recognition/neural-network.d.ts +1 -1
  27. package/dist/types/part-of-speech-recognition/neural-network.d.ts.map +1 -1
  28. package/dist/types/part-of-speech-recognition/part-of-speech-decoder.d.ts.map +1 -1
  29. package/dist/types/part-of-speech-recognition/part-of-speech-recognition-rule.d.ts +1 -1
  30. package/dist/types/part-of-speech-recognition/part-of-speech-recognition-rule.d.ts.map +1 -1
  31. package/dist/types/part-of-speech-recognition/part-of-speech-recognizer.d.ts +1 -1
  32. package/dist/types/part-of-speech-recognition/part-of-speech-recognizer.d.ts.map +1 -1
  33. package/dist/types/shevchenko.d.ts +3 -2
  34. package/dist/types/shevchenko.d.ts.map +1 -1
  35. package/dist/types/utils/string.utils.d.ts.map +1 -1
  36. package/dist/umd/shevchenko.min.js +4 -4
  37. package/dist/umd/shevchenko.min.js.map +1 -1
  38. package/nuxt/components/declension-demo.vue +7 -1
  39. package/nuxt/components/declension-form.vue +77 -10
  40. package/nuxt/components/declension-results.vue +26 -7
  41. package/nuxt/components/how-it-works.vue +10 -10
  42. package/nuxt/composables/declension.ts +47 -4
  43. package/nuxt/data/female-first-names.json +556 -0
  44. package/nuxt/data/male-first-names.json +603 -0
  45. package/nuxt/locales/en-US.json +6 -3
  46. package/nuxt/locales/uk-UA.json +8 -5
  47. package/nuxt/package-lock.json +7 -7
  48. package/nuxt/package.json +2 -2
  49. package/package.json +13 -10
  50. package/src/anthroponym-inflection/anthroponym-inflector.ts +20 -5
  51. package/src/anthroponym-inflection/command-runner-factory.ts +2 -2
  52. package/src/anthroponym-inflection/first-name-inflector.ts +5 -5
  53. package/src/anthroponym-inflection/inflector.types.ts +19 -19
  54. package/src/anthroponym-inflection/last-name-inflector.ts +10 -6
  55. package/src/anthroponym-inflection/middle-name-inflector.ts +5 -5
  56. package/src/anthroponym-inflection/name-inflector.ts +9 -3
  57. package/src/anthroponym-inflection/replace-command-runner.ts +1 -1
  58. package/src/anthroponym-inflection/rule-inflector.ts +2 -2
  59. package/src/bootstrap.ts +10 -10
  60. package/src/core/validator.ts +12 -5
  61. package/src/gender-detection/detect-gender.ts +43 -0
  62. package/src/gender-detection/given-names-genders.json +1144 -0
  63. package/src/gender-detection/index.ts +1 -0
  64. package/src/part-of-speech-recognition/neural-network.ts +10 -5
  65. package/src/part-of-speech-recognition/part-of-speech-decoder.ts +1 -1
  66. package/src/part-of-speech-recognition/part-of-speech-recognition-rule.ts +6 -2
  67. package/src/part-of-speech-recognition/part-of-speech-recognizer.ts +2 -2
  68. package/src/part-of-speech-recognition/word-encoder.ts +2 -2
  69. package/src/resources/inflector/rules.json +27 -26
  70. package/src/shevchenko.ts +4 -3
  71. package/src/utils/string.utils.ts +3 -3
  72. package/test/anthroponym-inflection.js +58 -0
  73. package/test/gender-detection.js +29 -0
  74. package/test/input-validation.js +353 -0
  75. package/test/main.test.js +18 -0
  76. package/test/samples.json +7282 -0
  77. package/tsconfig.types.json +9 -0
package/.eslintrc.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "env": {
3
+ "browser": true,
4
+ "es2021": true,
5
+ "node": true
6
+ },
7
+ "extends": [
8
+ "plugin:import/recommended",
9
+ "plugin:@typescript-eslint/recommended",
10
+ "prettier"
11
+ ],
12
+ "overrides": [],
13
+ "parser": "@typescript-eslint/parser",
14
+ "parserOptions": {
15
+ "ecmaVersion": "latest",
16
+ "sourceType": "module"
17
+ },
18
+ "plugins": [
19
+ "@typescript-eslint",
20
+ "prettier"
21
+ ],
22
+ "rules": {
23
+ "prettier/prettier": "error",
24
+ "sort-imports": [
25
+ "error",
26
+ {
27
+ "ignoreCase": true,
28
+ "ignoreDeclarationSort": true
29
+ }
30
+ ],
31
+ "import/no-cycle": 2,
32
+ "import/no-unresolved": "off",
33
+ "import/order": [
34
+ "error",
35
+ {
36
+ "groups": [
37
+ "builtin",
38
+ "external",
39
+ "internal",
40
+ "parent",
41
+ "sibling",
42
+ "index",
43
+ "unknown"
44
+ ],
45
+ "newlines-between": "never",
46
+ "alphabetize": {
47
+ "order": "asc",
48
+ "caseInsensitive": true
49
+ }
50
+ }
51
+ ]
52
+ }
53
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "printWidth": 100,
3
+ "singleQuote": true,
4
+ "trailingComma": "all"
5
+ }