shevchenko 2.1.3 → 3.0.0-rc.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.
- package/.github/workflows/npm-publish.yml +36 -0
- package/README.md +8 -7
- package/dist/cjs/anthroponym-declension/anthroponym-inflector.js +39 -0
- package/dist/cjs/anthroponym-declension/anthroponym-inflector.js.map +1 -0
- package/dist/cjs/anthroponym-declension/family-name-inflector.js +69 -0
- package/dist/cjs/anthroponym-declension/family-name-inflector.js.map +1 -0
- package/dist/cjs/anthroponym-declension/given-name-inflector.js +40 -0
- package/dist/cjs/anthroponym-declension/given-name-inflector.js.map +1 -0
- package/dist/cjs/anthroponym-declension/name-inflector.js +30 -0
- package/dist/cjs/anthroponym-declension/name-inflector.js.map +1 -0
- package/dist/cjs/anthroponym-declension/patronymic-name-inflector.js +40 -0
- package/dist/cjs/anthroponym-declension/patronymic-name-inflector.js.map +1 -0
- package/dist/cjs/bootstrap.js +29 -0
- package/dist/cjs/bootstrap.js.map +1 -0
- package/dist/cjs/gender-detection/detect-gender.js +55 -0
- package/dist/cjs/gender-detection/detect-gender.js.map +1 -0
- package/dist/cjs/gender-detection/given-names-genders.json.js +1158 -0
- package/dist/cjs/gender-detection/given-names-genders.json.js.map +1 -0
- package/dist/cjs/index.js +36 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/cjs/input-validation.js +83 -0
- package/dist/cjs/input-validation.js.map +1 -0
- package/dist/cjs/language/alphabet.js +54 -0
- package/dist/cjs/language/alphabet.js.map +1 -0
- package/dist/cjs/language/grammatical-case.js +27 -0
- package/dist/cjs/language/grammatical-case.js.map +1 -0
- package/dist/cjs/language/grammatical-gender.js +22 -0
- package/dist/cjs/language/grammatical-gender.js.map +1 -0
- package/dist/cjs/language/letter-case.js +49 -0
- package/dist/cjs/language/letter-case.js.map +1 -0
- package/dist/cjs/language/linguistics.js +35 -0
- package/dist/cjs/language/linguistics.js.map +1 -0
- package/dist/cjs/language/word-class.js +22 -0
- package/dist/cjs/language/word-class.js.map +1 -0
- package/dist/cjs/shevchenko.js +67 -154555
- package/dist/cjs/shevchenko.js.map +1 -1
- package/dist/cjs/word-class-recognition/artifacts/model.bundle.json.js +199 -0
- package/dist/cjs/word-class-recognition/artifacts/model.bundle.json.js.map +1 -0
- package/dist/cjs/word-class-recognition/cache/incorrect-predictions.json.js +1459 -0
- package/dist/cjs/word-class-recognition/cache/incorrect-predictions.json.js.map +1 -0
- package/dist/cjs/word-class-recognition/model-bundle-loader.js +74 -0
- package/dist/cjs/word-class-recognition/model-bundle-loader.js.map +1 -0
- package/dist/cjs/word-class-recognition/model-config.js +20 -0
- package/dist/cjs/word-class-recognition/model-config.js.map +1 -0
- package/dist/cjs/word-class-recognition/word-class-recognizer.js +76 -0
- package/dist/cjs/word-class-recognition/word-class-recognizer.js.map +1 -0
- package/dist/cjs/word-class-recognition/word-class-transformer.js +52 -0
- package/dist/cjs/word-class-recognition/word-class-transformer.js.map +1 -0
- package/dist/cjs/word-class-recognition/word-transformer.js +37 -0
- package/dist/cjs/word-class-recognition/word-transformer.js.map +1 -0
- package/dist/cjs/word-declension/append-command-runner.js +28 -0
- package/dist/cjs/word-declension/append-command-runner.js.map +1 -0
- package/dist/cjs/word-declension/command-runner-factory.js +38 -0
- package/dist/cjs/word-declension/command-runner-factory.js.map +1 -0
- package/dist/cjs/word-declension/declension-rule-inflector.js +65 -0
- package/dist/cjs/word-declension/declension-rule-inflector.js.map +1 -0
- package/dist/cjs/word-declension/declension-rule-matchers.js +43 -0
- package/dist/cjs/word-declension/declension-rule-matchers.js.map +1 -0
- package/dist/cjs/word-declension/declension-rules.json.js +7405 -0
- package/dist/cjs/word-declension/declension-rules.json.js.map +1 -0
- package/dist/cjs/word-declension/declension-types.js +24 -0
- package/dist/cjs/word-declension/declension-types.js.map +1 -0
- package/dist/cjs/word-declension/index.js +28 -0
- package/dist/cjs/word-declension/index.js.map +1 -0
- package/dist/cjs/word-declension/replace-command-runner.js +28 -0
- package/dist/cjs/word-declension/replace-command-runner.js.map +1 -0
- package/dist/es/anthroponym-declension/anthroponym-inflector.d.ts +16 -0
- package/dist/es/anthroponym-declension/anthroponym-inflector.d.ts.map +1 -0
- package/dist/es/anthroponym-declension/anthroponym-inflector.js +35 -0
- package/dist/es/anthroponym-declension/anthroponym-inflector.js.map +1 -0
- package/dist/es/anthroponym-declension/anthroponym.d.ts +6 -0
- package/dist/es/anthroponym-declension/anthroponym.d.ts.map +1 -0
- package/dist/es/anthroponym-declension/family-name-inflector.d.ts +14 -0
- package/dist/es/anthroponym-declension/family-name-inflector.d.ts.map +1 -0
- package/dist/es/anthroponym-declension/family-name-inflector.js +65 -0
- package/dist/es/anthroponym-declension/family-name-inflector.js.map +1 -0
- package/dist/es/anthroponym-declension/given-name-inflector.d.ts +12 -0
- package/dist/es/anthroponym-declension/given-name-inflector.d.ts.map +1 -0
- package/dist/es/anthroponym-declension/given-name-inflector.js +36 -0
- package/dist/es/anthroponym-declension/given-name-inflector.js.map +1 -0
- package/dist/es/anthroponym-declension/index.d.ts +6 -0
- package/dist/es/anthroponym-declension/index.d.ts.map +1 -0
- package/dist/es/anthroponym-declension/name-inflector.d.ts +12 -0
- package/dist/es/anthroponym-declension/name-inflector.d.ts.map +1 -0
- package/dist/es/anthroponym-declension/name-inflector.js +26 -0
- package/dist/es/anthroponym-declension/name-inflector.js.map +1 -0
- package/dist/es/anthroponym-declension/patronymic-name-inflector.d.ts +12 -0
- package/dist/es/anthroponym-declension/patronymic-name-inflector.d.ts.map +1 -0
- package/dist/es/anthroponym-declension/patronymic-name-inflector.js +36 -0
- package/dist/es/anthroponym-declension/patronymic-name-inflector.js.map +1 -0
- package/dist/es/bootstrap.d.ts +4 -0
- package/dist/{types → es}/bootstrap.d.ts.map +1 -1
- package/dist/es/bootstrap.js +25 -0
- package/dist/es/bootstrap.js.map +1 -0
- package/dist/es/contracts.d.ts +21 -0
- package/dist/es/contracts.d.ts.map +1 -0
- package/dist/es/gender-detection/detect-gender.d.ts +11 -0
- package/dist/es/gender-detection/detect-gender.d.ts.map +1 -0
- package/dist/es/gender-detection/detect-gender.js +51 -0
- package/dist/es/gender-detection/detect-gender.js.map +1 -0
- package/dist/es/gender-detection/detect-gender.test.d.ts +2 -0
- package/dist/es/gender-detection/detect-gender.test.d.ts.map +1 -0
- package/dist/es/gender-detection/given-names-genders.json.js +1156 -0
- package/dist/es/gender-detection/given-names-genders.json.js.map +1 -0
- package/dist/es/gender-detection/index.d.ts +2 -0
- package/dist/es/gender-detection/index.d.ts.map +1 -0
- package/dist/es/index.d.ts +2 -0
- package/dist/es/index.d.ts.map +1 -0
- package/dist/es/index.js +13 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/input-validation.d.ts +14 -0
- package/dist/es/input-validation.d.ts.map +1 -0
- package/dist/es/input-validation.js +78 -0
- package/dist/es/input-validation.js.map +1 -0
- package/dist/es/input-validation.test.d.ts +2 -0
- package/dist/es/input-validation.test.d.ts.map +1 -0
- package/dist/es/language/alphabet.d.ts +48 -0
- package/dist/es/language/alphabet.d.ts.map +1 -0
- package/dist/es/language/alphabet.js +52 -0
- package/dist/es/language/alphabet.js.map +1 -0
- package/dist/es/language/grammatical-case.d.ts +13 -0
- package/dist/es/language/grammatical-case.d.ts.map +1 -0
- package/dist/es/language/grammatical-case.js +25 -0
- package/dist/es/language/grammatical-case.js.map +1 -0
- package/dist/es/language/grammatical-gender.d.ts +8 -0
- package/dist/es/language/grammatical-gender.d.ts.map +1 -0
- package/dist/es/language/grammatical-gender.js +20 -0
- package/dist/es/language/grammatical-gender.js.map +1 -0
- package/dist/es/language/index.d.ts +7 -0
- package/dist/es/language/index.d.ts.map +1 -0
- package/dist/es/language/letter-case.d.ts +6 -0
- package/dist/es/language/letter-case.d.ts.map +1 -0
- package/dist/es/language/letter-case.js +45 -0
- package/dist/es/language/letter-case.js.map +1 -0
- package/dist/es/language/letter-case.test.d.ts +2 -0
- package/dist/es/language/letter-case.test.d.ts.map +1 -0
- package/dist/es/language/linguistics.d.ts +7 -0
- package/dist/es/language/linguistics.d.ts.map +1 -0
- package/dist/es/language/linguistics.js +30 -0
- package/dist/es/language/linguistics.js.map +1 -0
- package/dist/es/language/linguistics.test.d.ts +2 -0
- package/dist/es/language/linguistics.test.d.ts.map +1 -0
- package/dist/es/language/word-class.d.ts +8 -0
- package/dist/es/language/word-class.d.ts.map +1 -0
- package/dist/es/language/word-class.js +20 -0
- package/dist/es/language/word-class.js.map +1 -0
- package/dist/es/shevchenko.d.ts +54 -0
- package/dist/es/shevchenko.d.ts.map +1 -0
- package/dist/es/shevchenko.js +60 -154480
- package/dist/es/shevchenko.js.map +1 -1
- package/dist/es/word-class-recognition/artifacts/model.bundle.json.js +190 -0
- package/dist/es/word-class-recognition/artifacts/model.bundle.json.js.map +1 -0
- package/dist/es/word-class-recognition/cache/incorrect-predictions.json.js +1457 -0
- package/dist/es/word-class-recognition/cache/incorrect-predictions.json.js.map +1 -0
- package/dist/es/word-class-recognition/data.utils.d.ts +16 -0
- package/dist/es/word-class-recognition/data.utils.d.ts.map +1 -0
- package/dist/es/word-class-recognition/index.d.ts +3 -0
- package/dist/es/word-class-recognition/index.d.ts.map +1 -0
- package/dist/es/word-class-recognition/model-bundle-loader.d.ts +15 -0
- package/dist/es/word-class-recognition/model-bundle-loader.d.ts.map +1 -0
- package/dist/es/word-class-recognition/model-bundle-loader.js +69 -0
- package/dist/es/word-class-recognition/model-bundle-loader.js.map +1 -0
- package/dist/es/word-class-recognition/model-bundle-saver.d.ts +12 -0
- package/dist/es/word-class-recognition/model-bundle-saver.d.ts.map +1 -0
- package/dist/es/word-class-recognition/model-config.d.ts +5 -0
- package/dist/es/word-class-recognition/model-config.d.ts.map +1 -0
- package/dist/es/word-class-recognition/model-config.js +16 -0
- package/dist/es/word-class-recognition/model-config.js.map +1 -0
- package/dist/es/word-class-recognition/scripts/cache-incorrect-predictions.d.ts +2 -0
- package/dist/es/word-class-recognition/scripts/cache-incorrect-predictions.d.ts.map +1 -0
- package/dist/es/word-class-recognition/scripts/train-model.d.ts +7 -0
- package/dist/es/word-class-recognition/scripts/train-model.d.ts.map +1 -0
- package/dist/es/word-class-recognition/word-class-recognizer.d.ts +18 -0
- package/dist/es/word-class-recognition/word-class-recognizer.d.ts.map +1 -0
- package/dist/es/word-class-recognition/word-class-recognizer.js +52 -0
- package/dist/es/word-class-recognition/word-class-recognizer.js.map +1 -0
- package/dist/es/word-class-recognition/word-class-transformer.d.ts +6 -0
- package/dist/es/word-class-recognition/word-class-transformer.d.ts.map +1 -0
- package/dist/es/word-class-recognition/word-class-transformer.js +48 -0
- package/dist/es/word-class-recognition/word-class-transformer.js.map +1 -0
- package/dist/es/word-class-recognition/word-class-transformer.test.d.ts +2 -0
- package/dist/es/word-class-recognition/word-class-transformer.test.d.ts.map +1 -0
- package/dist/es/word-class-recognition/word-transformer.d.ts +7 -0
- package/dist/es/word-class-recognition/word-transformer.d.ts.map +1 -0
- package/dist/es/word-class-recognition/word-transformer.js +33 -0
- package/dist/es/word-class-recognition/word-transformer.js.map +1 -0
- package/dist/es/word-class-recognition/word-transformer.test.d.ts +2 -0
- package/dist/es/word-class-recognition/word-transformer.test.d.ts.map +1 -0
- package/dist/es/word-declension/append-command-runner.d.ts +12 -0
- package/dist/es/word-declension/append-command-runner.d.ts.map +1 -0
- package/dist/es/word-declension/append-command-runner.js +24 -0
- package/dist/es/word-declension/append-command-runner.js.map +1 -0
- package/dist/es/word-declension/command-runner-factory.d.ts +9 -0
- package/dist/es/word-declension/command-runner-factory.d.ts.map +1 -0
- package/dist/es/word-declension/command-runner-factory.js +34 -0
- package/dist/es/word-declension/command-runner-factory.js.map +1 -0
- package/dist/es/word-declension/declension-rule-inflector.d.ts +16 -0
- package/dist/es/word-declension/declension-rule-inflector.d.ts.map +1 -0
- package/dist/es/word-declension/declension-rule-inflector.js +60 -0
- package/dist/es/word-declension/declension-rule-inflector.js.map +1 -0
- package/dist/es/word-declension/declension-rule-matchers.d.ts +19 -0
- package/dist/es/word-declension/declension-rule-matchers.d.ts.map +1 -0
- package/dist/es/word-declension/declension-rule-matchers.js +36 -0
- package/dist/es/word-declension/declension-rule-matchers.js.map +1 -0
- package/dist/es/word-declension/declension-rules.json.js +7403 -0
- package/dist/es/word-declension/declension-rules.json.js.map +1 -0
- package/dist/es/word-declension/declension-types.d.ts +36 -0
- package/dist/es/word-declension/declension-types.d.ts.map +1 -0
- package/dist/es/word-declension/declension-types.js +22 -0
- package/dist/es/word-declension/declension-types.js.map +1 -0
- package/dist/es/word-declension/index.d.ts +7 -0
- package/dist/es/word-declension/index.d.ts.map +1 -0
- package/dist/es/word-declension/index.js +20 -0
- package/dist/es/word-declension/index.js.map +1 -0
- package/dist/es/word-declension/inflection-command-runner.d.ts +4 -0
- package/dist/es/word-declension/inflection-command-runner.d.ts.map +1 -0
- package/dist/es/word-declension/replace-command-runner.d.ts +12 -0
- package/dist/es/word-declension/replace-command-runner.d.ts.map +1 -0
- package/dist/es/word-declension/replace-command-runner.js +24 -0
- package/dist/es/word-declension/replace-command-runner.js.map +1 -0
- package/dist/es/word-declension/scripts/load-declension-rules.d.ts +2 -0
- package/dist/es/word-declension/scripts/load-declension-rules.d.ts.map +1 -0
- package/dist/umd/shevchenko.min.js +4680 -68
- package/dist/umd/shevchenko.min.js.map +1 -1
- package/package.json +38 -37
- package/src/anthroponym-declension/README.md +3 -0
- package/src/anthroponym-declension/anthroponym-inflector.ts +58 -0
- package/src/anthroponym-declension/anthroponym.ts +5 -0
- package/src/anthroponym-declension/family-name-inflector.ts +75 -0
- package/src/anthroponym-declension/given-name-inflector.ts +38 -0
- package/src/anthroponym-declension/index.ts +5 -0
- package/src/anthroponym-declension/name-inflector.ts +38 -0
- package/src/anthroponym-declension/patronymic-name-inflector.ts +38 -0
- package/src/bootstrap.ts +20 -47
- package/src/contracts.ts +22 -0
- package/src/gender-detection/README.md +5 -0
- package/src/gender-detection/detect-gender.ts +43 -0
- package/src/gender-detection/given-names-genders.json +1144 -0
- package/src/gender-detection/index.ts +1 -0
- package/src/index.ts +1 -0
- package/src/input-validation.ts +80 -0
- package/src/language/README.md +3 -0
- package/src/language/alphabet.ts +49 -0
- package/src/language/grammatical-case.ts +12 -0
- package/src/language/grammatical-gender.ts +7 -0
- package/src/language/index.ts +6 -0
- package/src/language/letter-case.ts +35 -0
- package/src/language/linguistics.ts +20 -0
- package/src/language/word-class.ts +7 -0
- package/src/shevchenko.ts +65 -33
- package/src/word-class-recognition/README.md +5 -0
- package/src/word-class-recognition/artifacts/model.bundle.json +7 -0
- package/src/word-class-recognition/artifacts/model.json +1 -0
- package/src/word-class-recognition/artifacts/weights.bin +0 -0
- package/src/word-class-recognition/cache/incorrect-predictions.json +1445 -0
- package/src/word-class-recognition/data.utils.ts +57 -0
- package/src/word-class-recognition/index.ts +2 -0
- package/src/word-class-recognition/model-bundle-loader.ts +73 -0
- package/src/word-class-recognition/model-bundle-saver.ts +105 -0
- package/src/word-class-recognition/model-config.ts +4 -0
- package/src/word-class-recognition/scripts/cache-incorrect-predictions.ts +46 -0
- package/src/word-class-recognition/scripts/train-model.ts +95 -0
- package/src/word-class-recognition/word-class-recognizer.ts +54 -0
- package/src/word-class-recognition/word-class-transformer.ts +38 -0
- package/src/word-class-recognition/word-transformer.ts +23 -0
- package/src/word-declension/README.md +3 -0
- package/src/word-declension/append-command-runner.ts +18 -0
- package/src/word-declension/command-runner-factory.ts +23 -0
- package/src/{anthroponym-inflection/rule-inflector.ts → word-declension/declension-rule-inflector.ts} +17 -7
- package/src/word-declension/declension-rule-matchers.ts +30 -0
- package/src/{resources/inflector/rules.json → word-declension/declension-rules.json} +1119 -1119
- package/src/word-declension/declension-types.ts +41 -0
- package/src/word-declension/index.ts +9 -0
- package/src/word-declension/inflection-command-runner.ts +3 -0
- package/src/word-declension/replace-command-runner.ts +18 -0
- package/src/word-declension/scripts/load-declension-rules.ts +14 -0
- package/dist/types/anthroponym-inflection/anthroponym-inflector.d.ts +0 -15
- package/dist/types/anthroponym-inflection/anthroponym-inflector.d.ts.map +0 -1
- package/dist/types/anthroponym-inflection/append-command-runner.d.ts +0 -12
- package/dist/types/anthroponym-inflection/append-command-runner.d.ts.map +0 -1
- package/dist/types/anthroponym-inflection/command-runner-factory.d.ts +0 -9
- package/dist/types/anthroponym-inflection/command-runner-factory.d.ts.map +0 -1
- package/dist/types/anthroponym-inflection/first-name-inflector.d.ts +0 -12
- package/dist/types/anthroponym-inflection/first-name-inflector.d.ts.map +0 -1
- package/dist/types/anthroponym-inflection/index.d.ts +0 -6
- package/dist/types/anthroponym-inflection/index.d.ts.map +0 -1
- package/dist/types/anthroponym-inflection/inflector-command-runner.d.ts +0 -4
- package/dist/types/anthroponym-inflection/inflector-command-runner.d.ts.map +0 -1
- package/dist/types/anthroponym-inflection/inflector.types.d.ts +0 -37
- package/dist/types/anthroponym-inflection/inflector.types.d.ts.map +0 -1
- package/dist/types/anthroponym-inflection/last-name-inflector.d.ts +0 -14
- package/dist/types/anthroponym-inflection/last-name-inflector.d.ts.map +0 -1
- package/dist/types/anthroponym-inflection/middle-name-inflector.d.ts +0 -12
- package/dist/types/anthroponym-inflection/middle-name-inflector.d.ts.map +0 -1
- package/dist/types/anthroponym-inflection/name-inflector.d.ts +0 -12
- package/dist/types/anthroponym-inflection/name-inflector.d.ts.map +0 -1
- package/dist/types/anthroponym-inflection/replace-command-runner.d.ts +0 -12
- package/dist/types/anthroponym-inflection/replace-command-runner.d.ts.map +0 -1
- package/dist/types/anthroponym-inflection/rule-inflector.d.ts +0 -12
- package/dist/types/anthroponym-inflection/rule-inflector.d.ts.map +0 -1
- package/dist/types/bootstrap.d.ts +0 -4
- package/dist/types/core/anthroponym.interface.d.ts +0 -8
- package/dist/types/core/anthroponym.interface.d.ts.map +0 -1
- package/dist/types/core/gender.enum.d.ts +0 -5
- package/dist/types/core/gender.enum.d.ts.map +0 -1
- package/dist/types/core/grammatical-case.enum.d.ts +0 -10
- package/dist/types/core/grammatical-case.enum.d.ts.map +0 -1
- package/dist/types/core/index.d.ts +0 -5
- package/dist/types/core/index.d.ts.map +0 -1
- package/dist/types/core/validator.d.ts +0 -8
- package/dist/types/core/validator.d.ts.map +0 -1
- package/dist/types/internal.d.ts +0 -2
- package/dist/types/internal.d.ts.map +0 -1
- package/dist/types/part-of-speech-recognition/index.d.ts +0 -6
- package/dist/types/part-of-speech-recognition/index.d.ts.map +0 -1
- package/dist/types/part-of-speech-recognition/neural-network-config.d.ts +0 -6
- package/dist/types/part-of-speech-recognition/neural-network-config.d.ts.map +0 -1
- package/dist/types/part-of-speech-recognition/neural-network-training-data.d.ts +0 -5
- package/dist/types/part-of-speech-recognition/neural-network-training-data.d.ts.map +0 -1
- package/dist/types/part-of-speech-recognition/neural-network.d.ts +0 -28
- package/dist/types/part-of-speech-recognition/neural-network.d.ts.map +0 -1
- package/dist/types/part-of-speech-recognition/part-of-speech-decoder.d.ts +0 -9
- package/dist/types/part-of-speech-recognition/part-of-speech-decoder.d.ts.map +0 -1
- package/dist/types/part-of-speech-recognition/part-of-speech-encoder.d.ts +0 -10
- package/dist/types/part-of-speech-recognition/part-of-speech-encoder.d.ts.map +0 -1
- package/dist/types/part-of-speech-recognition/part-of-speech-recognition-rule.d.ts +0 -19
- package/dist/types/part-of-speech-recognition/part-of-speech-recognition-rule.d.ts.map +0 -1
- package/dist/types/part-of-speech-recognition/part-of-speech-recognizer.d.ts +0 -14
- package/dist/types/part-of-speech-recognition/part-of-speech-recognizer.d.ts.map +0 -1
- package/dist/types/part-of-speech-recognition/part-of-speech.enum.d.ts +0 -5
- package/dist/types/part-of-speech-recognition/part-of-speech.enum.d.ts.map +0 -1
- package/dist/types/part-of-speech-recognition/word-encoder.d.ts +0 -9
- package/dist/types/part-of-speech-recognition/word-encoder.d.ts.map +0 -1
- package/dist/types/part-of-speech-recognition/word-transformer.d.ts +0 -7
- package/dist/types/part-of-speech-recognition/word-transformer.d.ts.map +0 -1
- package/dist/types/shevchenko.d.ts +0 -32
- package/dist/types/shevchenko.d.ts.map +0 -1
- package/dist/types/utils/lang.utils.d.ts +0 -7
- package/dist/types/utils/lang.utils.d.ts.map +0 -1
- package/dist/types/utils/regexp.utils.d.ts +0 -5
- package/dist/types/utils/regexp.utils.d.ts.map +0 -1
- package/dist/types/utils/string.utils.d.ts +0 -14
- package/dist/types/utils/string.utils.d.ts.map +0 -1
- package/nuxt/.eslintrc.json +0 -27
- package/nuxt/.prettierrc.json +0 -6
- package/nuxt/README.md +0 -27
- package/nuxt/app.config.ts +0 -3
- package/nuxt/app.vue +0 -5
- package/nuxt/assets/img/shevchenko_pixelized_304x304.jpg +0 -0
- package/nuxt/assets/img/shevchenko_pixelized_304x304.png +0 -0
- package/nuxt/assets/img/shevchenko_pixelized_608x608.jpg +0 -0
- package/nuxt/assets/style/main.scss +0 -3
- package/nuxt/components/about-modal.vue +0 -58
- package/nuxt/components/api-spec.vue +0 -25
- package/nuxt/components/contact-me-button.vue +0 -11
- package/nuxt/components/contact-me-modal.vue +0 -63
- package/nuxt/components/copy-button.vue +0 -38
- package/nuxt/components/declension-demo.vue +0 -38
- package/nuxt/components/declension-form.vue +0 -158
- package/nuxt/components/declension-preview.vue +0 -170
- package/nuxt/components/declension-results.vue +0 -135
- package/nuxt/components/error-404.vue +0 -15
- package/nuxt/components/github-issue-count.vue +0 -18
- package/nuxt/components/how-it-works.vue +0 -51
- package/nuxt/components/installation-instructions.vue +0 -33
- package/nuxt/components/library-docs.vue +0 -27
- package/nuxt/components/page-copyright.vue +0 -15
- package/nuxt/components/page-footer.vue +0 -32
- package/nuxt/components/page-header.vue +0 -4
- package/nuxt/components/preview-banner.vue +0 -32
- package/nuxt/components/share-links.vue +0 -108
- package/nuxt/components/top-nav-bar.vue +0 -165
- package/nuxt/components/ukrainian-flag.vue +0 -37
- package/nuxt/components/usage-example.vue +0 -32
- package/nuxt/composables/declension.ts +0 -124
- package/nuxt/composables/page-i18n.ts +0 -11
- package/nuxt/composables/page-meta.ts +0 -5
- package/nuxt/composables/route-utils.ts +0 -17
- package/nuxt/config.ts +0 -20
- package/nuxt/data/female-first-names.json +0 -556
- package/nuxt/data/male-first-names.json +0 -603
- package/nuxt/error.vue +0 -25
- package/nuxt/layouts/default.vue +0 -5
- package/nuxt/locales/en-US.json +0 -63
- package/nuxt/locales/uk-UA.json +0 -65
- package/nuxt/nuxt.config.ts +0 -99
- package/nuxt/package-lock.json +0 -19524
- package/nuxt/package.json +0 -37
- package/nuxt/pages/en-US/index.vue +0 -41
- package/nuxt/pages/index.vue +0 -68
- package/nuxt/plugins/i18n.ts +0 -26
- package/nuxt/public/.nojekyll +0 -0
- package/nuxt/public/CNAME +0 -1
- package/nuxt/public/android-icon-144x144.png +0 -0
- package/nuxt/public/android-icon-192x192.png +0 -0
- package/nuxt/public/android-icon-36x36.png +0 -0
- package/nuxt/public/android-icon-48x48.png +0 -0
- package/nuxt/public/android-icon-72x72.png +0 -0
- package/nuxt/public/android-icon-96x96.png +0 -0
- package/nuxt/public/apple-icon-114x114.png +0 -0
- package/nuxt/public/apple-icon-120x120.png +0 -0
- package/nuxt/public/apple-icon-144x144.png +0 -0
- package/nuxt/public/apple-icon-152x152.png +0 -0
- package/nuxt/public/apple-icon-180x180.png +0 -0
- package/nuxt/public/apple-icon-57x57.png +0 -0
- package/nuxt/public/apple-icon-60x60.png +0 -0
- package/nuxt/public/apple-icon-72x72.png +0 -0
- package/nuxt/public/apple-icon-76x76.png +0 -0
- package/nuxt/public/apple-icon-precomposed.png +0 -0
- package/nuxt/public/apple-icon.png +0 -0
- package/nuxt/public/browserconfig.xml +0 -2
- package/nuxt/public/favicon-16x16.png +0 -0
- package/nuxt/public/favicon-32x32.png +0 -0
- package/nuxt/public/favicon-96x96.png +0 -0
- package/nuxt/public/favicon.ico +0 -0
- package/nuxt/public/manifest.json +0 -41
- package/nuxt/public/ms-icon-144x144.png +0 -0
- package/nuxt/public/ms-icon-150x150.png +0 -0
- package/nuxt/public/ms-icon-310x310.png +0 -0
- package/nuxt/public/ms-icon-70x70.png +0 -0
- package/nuxt/public/preview-608x608.jpg +0 -0
- package/nuxt/scripts/postgenerate.js +0 -7
- package/nuxt/scripts/publish.js +0 -7
- package/nuxt/server/plugins/google-tag-manager.js +0 -37
- package/nuxt/tsconfig.json +0 -11
- package/src/anthroponym-inflection/anthroponym-inflector.ts +0 -38
- package/src/anthroponym-inflection/append-command-runner.ts +0 -18
- package/src/anthroponym-inflection/command-runner-factory.ts +0 -23
- package/src/anthroponym-inflection/first-name-inflector.ts +0 -41
- package/src/anthroponym-inflection/index.ts +0 -5
- package/src/anthroponym-inflection/inflector-command-runner.ts +0 -3
- package/src/anthroponym-inflection/inflector.types.ts +0 -42
- package/src/anthroponym-inflection/last-name-inflector.ts +0 -54
- package/src/anthroponym-inflection/middle-name-inflector.ts +0 -29
- package/src/anthroponym-inflection/name-inflector.ts +0 -19
- package/src/anthroponym-inflection/replace-command-runner.ts +0 -18
- package/src/core/anthroponym.interface.ts +0 -8
- package/src/core/gender.enum.ts +0 -4
- package/src/core/grammatical-case.enum.ts +0 -9
- package/src/core/index.ts +0 -4
- package/src/core/validator.ts +0 -39
- package/src/internal.ts +0 -1
- package/src/part-of-speech-recognition/index.ts +0 -5
- package/src/part-of-speech-recognition/neural-network-config.ts +0 -5
- package/src/part-of-speech-recognition/neural-network-training-data.ts +0 -5
- package/src/part-of-speech-recognition/neural-network.ts +0 -66
- package/src/part-of-speech-recognition/part-of-speech-decoder.ts +0 -26
- package/src/part-of-speech-recognition/part-of-speech-encoder.ts +0 -20
- package/src/part-of-speech-recognition/part-of-speech-recognition-rule.ts +0 -33
- package/src/part-of-speech-recognition/part-of-speech-recognizer.ts +0 -26
- package/src/part-of-speech-recognition/part-of-speech.enum.ts +0 -4
- package/src/part-of-speech-recognition/word-encoder.ts +0 -23
- package/src/part-of-speech-recognition/word-transformer.ts +0 -8
- package/src/resources/neural-networks/kosmii/README.md +0 -5
- package/src/resources/neural-networks/kosmii/cache.json +0 -8
- package/src/resources/neural-networks/kosmii/samples.json +0 -9435
- package/src/resources/neural-networks/kosmii/structure.json +0 -47898
- package/src/resources/neural-networks/pelykh/README.md +0 -5
- package/src/resources/neural-networks/pelykh/cache.json +0 -1
- package/src/resources/neural-networks/pelykh/samples.json +0 -221
- package/src/resources/neural-networks/pelykh/structure.json +0 -47898
- package/src/resources/neural-networks/pohorielova/README.md +0 -5
- package/src/resources/neural-networks/pohorielova/cache.json +0 -542
- package/src/resources/neural-networks/pohorielova/samples.json +0 -32147
- package/src/resources/neural-networks/pohorielova/structure.json +0 -47898
- package/src/utils/lang.utils.ts +0 -13
- package/src/utils/regexp.utils.ts +0 -11
- package/src/utils/string.utils.ts +0 -49
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './detect-gender';
|
package/src/index.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './shevchenko';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { Anthroponym } from './anthroponym-declension';
|
|
2
|
+
import { DeclensionInput, GenderDetectionInput } from './contracts';
|
|
3
|
+
import { GrammaticalGender } from './language';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Validates if a given value is a valid input for declension.
|
|
7
|
+
*
|
|
8
|
+
* @throws {TypeError}
|
|
9
|
+
*/
|
|
10
|
+
export function validateDeclensionInput(input: DeclensionInput): void {
|
|
11
|
+
validateObject(input);
|
|
12
|
+
validateGender(input.gender);
|
|
13
|
+
validateAnthroponym(input);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Validates if a given value is a valid input for gender detection.
|
|
18
|
+
*
|
|
19
|
+
* @throws {TypeError}
|
|
20
|
+
*/
|
|
21
|
+
export function validateGenderDetectionInput(input: GenderDetectionInput): void {
|
|
22
|
+
validateObject(input);
|
|
23
|
+
validateAnthroponym(input);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Validates if a given value is an object.
|
|
28
|
+
*
|
|
29
|
+
* @throws {TypeError}
|
|
30
|
+
*/
|
|
31
|
+
function validateObject(object: unknown): void {
|
|
32
|
+
if (typeof object !== 'object' || object == null) {
|
|
33
|
+
throw new TypeError('The input type must be an object.');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Validates if a given value is a valid grammatical gender.
|
|
39
|
+
*
|
|
40
|
+
* @throws {TypeError}
|
|
41
|
+
*/
|
|
42
|
+
function validateGender(gender: GrammaticalGender): void {
|
|
43
|
+
if (![GrammaticalGender.MASCULINE, GrammaticalGender.FEMININE].includes(gender)) {
|
|
44
|
+
throw new TypeError(
|
|
45
|
+
`The "gender" parameter must be one of the following: "${GrammaticalGender.MASCULINE}", "${GrammaticalGender.FEMININE}".`,
|
|
46
|
+
);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* Validates if a given value is a valid anthroponym.
|
|
52
|
+
*
|
|
53
|
+
* @throws {TypeError}
|
|
54
|
+
*/
|
|
55
|
+
function validateAnthroponym(anthroponym: Anthroponym): void {
|
|
56
|
+
if (
|
|
57
|
+
typeof anthroponym.givenName === 'undefined' &&
|
|
58
|
+
typeof anthroponym.patronymicName === 'undefined' &&
|
|
59
|
+
typeof anthroponym.familyName === 'undefined'
|
|
60
|
+
) {
|
|
61
|
+
throw new TypeError(
|
|
62
|
+
'At least one of the following parameters must present: "givenName", "patronymicName", "familyName".',
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (typeof anthroponym.givenName !== 'undefined' && typeof anthroponym.givenName !== 'string') {
|
|
67
|
+
throw new TypeError('The "givenName" parameter must be a string.');
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
if (
|
|
71
|
+
typeof anthroponym.patronymicName !== 'undefined' &&
|
|
72
|
+
typeof anthroponym.patronymicName !== 'string'
|
|
73
|
+
) {
|
|
74
|
+
throw new TypeError('The "patronymicName" parameter must be a string.');
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (typeof anthroponym.familyName !== 'undefined' && typeof anthroponym.familyName !== 'string') {
|
|
78
|
+
throw new TypeError('The "familyName" parameter must be a string.');
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ukrainian alphabet encoding where the key is the letter of the alphabet
|
|
3
|
+
* and the value is the order number of the corresponding letter starting from 1.
|
|
4
|
+
*/
|
|
5
|
+
export enum AlphabetEncoding {
|
|
6
|
+
'а' = 1,
|
|
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
|
+
* Size of Ukrainian alphabet.
|
|
43
|
+
*/
|
|
44
|
+
export const ALPHABET_SIZE = 33;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Letter of Ukrainian alphabet.
|
|
48
|
+
*/
|
|
49
|
+
export type Letter = keyof typeof AlphabetEncoding;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enum representing the possible grammatical cases.
|
|
3
|
+
*/
|
|
4
|
+
export enum GrammaticalCase {
|
|
5
|
+
NOMINATIVE = 'nominative',
|
|
6
|
+
GENITIVE = 'genitive',
|
|
7
|
+
DATIVE = 'dative',
|
|
8
|
+
ACCUSATIVE = 'accusative',
|
|
9
|
+
ABLATIVE = 'ablative',
|
|
10
|
+
LOCATIVE = 'locative',
|
|
11
|
+
VOCATIVE = 'vocative',
|
|
12
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copies a letter case pattern from a template word to a target word.
|
|
3
|
+
* Returns a modified target word in the letter case of the template word.
|
|
4
|
+
*/
|
|
5
|
+
export function copyLetterCase(templateWord: string, targetWord: string): string {
|
|
6
|
+
let resultWord = '';
|
|
7
|
+
|
|
8
|
+
for (let index = 0; index < targetWord.length; index += 1) {
|
|
9
|
+
const templateLetter = templateWord[index] || templateWord[templateWord.length - 1];
|
|
10
|
+
const targetLetter = targetWord[index];
|
|
11
|
+
if (inLowerCase(templateLetter)) {
|
|
12
|
+
resultWord += targetLetter.toLowerCase();
|
|
13
|
+
} else if (inUpperCase(templateLetter)) {
|
|
14
|
+
resultWord += targetLetter.toUpperCase();
|
|
15
|
+
} else {
|
|
16
|
+
resultWord += targetLetter;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return resultWord;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Detects if a letter is in the upper case at the specified index.
|
|
25
|
+
*/
|
|
26
|
+
function inUpperCase(word: string, index = 0): boolean {
|
|
27
|
+
return word.charAt(index) === word.charAt(index).toUpperCase();
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Detects if a letter is in the lower case at the specified index.
|
|
32
|
+
*/
|
|
33
|
+
function inLowerCase(word: string, index = 0): boolean {
|
|
34
|
+
return word.charAt(index) === word.charAt(index).toLowerCase();
|
|
35
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export const PATTERN_VOWELS = /[аоуеиіяюєї]/gi;
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Returns a number of syllables in a given word.
|
|
5
|
+
*/
|
|
6
|
+
function countSyllables(word: string): number {
|
|
7
|
+
const matches = word.match(PATTERN_VOWELS);
|
|
8
|
+
if (matches == null) {
|
|
9
|
+
return 0;
|
|
10
|
+
}
|
|
11
|
+
return matches.length;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Returns true if a given word is a monosyllable.
|
|
16
|
+
* Returns false otherwise.
|
|
17
|
+
*/
|
|
18
|
+
export function isMonosyllable(word: string): boolean {
|
|
19
|
+
return countSyllables(word) === 1;
|
|
20
|
+
}
|
package/src/shevchenko.ts
CHANGED
|
@@ -1,63 +1,95 @@
|
|
|
1
|
-
import { Anthroponym, Gender, GrammaticalCase, validateAnthroponym } from './core';
|
|
2
1
|
import { anthroponymInflector } from './bootstrap';
|
|
2
|
+
import {
|
|
3
|
+
DeclensionInput,
|
|
4
|
+
DeclensionOutput,
|
|
5
|
+
GenderDetectionInput,
|
|
6
|
+
GenderDetectionOutput,
|
|
7
|
+
} from './contracts';
|
|
8
|
+
import { detectGender as autoDetectGender } from './gender-detection';
|
|
9
|
+
import { validateDeclensionInput, validateGenderDetectionInput } from './input-validation';
|
|
10
|
+
import { GrammaticalCase } from './language';
|
|
11
|
+
|
|
12
|
+
export * from './contracts';
|
|
13
|
+
export { GrammaticalGender, GrammaticalCase } from './language';
|
|
14
|
+
export { Anthroponym } from './anthroponym-declension';
|
|
3
15
|
|
|
4
16
|
/**
|
|
5
|
-
* Inflects
|
|
17
|
+
* Inflects an anthroponym in nominative grammatical case.
|
|
18
|
+
*
|
|
19
|
+
* @throws {TypeError} Input validation error.
|
|
6
20
|
*/
|
|
7
|
-
export function inNominative(
|
|
8
|
-
|
|
9
|
-
return anthroponymInflector.inflect(
|
|
21
|
+
export async function inNominative(input: DeclensionInput): Promise<DeclensionOutput> {
|
|
22
|
+
validateDeclensionInput(input);
|
|
23
|
+
return anthroponymInflector.inflect(input, input.gender, GrammaticalCase.NOMINATIVE);
|
|
10
24
|
}
|
|
11
25
|
|
|
12
26
|
/**
|
|
13
|
-
* Inflects
|
|
27
|
+
* Inflects an anthroponym in genitive grammatical case.
|
|
28
|
+
*
|
|
29
|
+
* @throws {TypeError} Input validation error.
|
|
14
30
|
*/
|
|
15
|
-
export function inGenitive(
|
|
16
|
-
|
|
17
|
-
return anthroponymInflector.inflect(
|
|
31
|
+
export async function inGenitive(input: DeclensionInput): Promise<DeclensionOutput> {
|
|
32
|
+
validateDeclensionInput(input);
|
|
33
|
+
return anthroponymInflector.inflect(input, input.gender, GrammaticalCase.GENITIVE);
|
|
18
34
|
}
|
|
19
35
|
|
|
20
36
|
/**
|
|
21
|
-
* Inflects
|
|
37
|
+
* Inflects an anthroponym in dative grammatical case.
|
|
38
|
+
*
|
|
39
|
+
* @throws {TypeError} Input validation error.
|
|
22
40
|
*/
|
|
23
|
-
export function inDative(
|
|
24
|
-
|
|
25
|
-
return anthroponymInflector.inflect(
|
|
41
|
+
export async function inDative(input: DeclensionInput): Promise<DeclensionOutput> {
|
|
42
|
+
validateDeclensionInput(input);
|
|
43
|
+
return anthroponymInflector.inflect(input, input.gender, GrammaticalCase.DATIVE);
|
|
26
44
|
}
|
|
27
45
|
|
|
28
46
|
/**
|
|
29
|
-
* Inflects
|
|
47
|
+
* Inflects an anthroponym in accusative grammatical case.
|
|
48
|
+
*
|
|
49
|
+
* @throws {TypeError} Input validation error.
|
|
30
50
|
*/
|
|
31
|
-
export function inAccusative(
|
|
32
|
-
|
|
33
|
-
return anthroponymInflector.inflect(
|
|
51
|
+
export async function inAccusative(input: DeclensionInput): Promise<DeclensionOutput> {
|
|
52
|
+
validateDeclensionInput(input);
|
|
53
|
+
return anthroponymInflector.inflect(input, input.gender, GrammaticalCase.ACCUSATIVE);
|
|
34
54
|
}
|
|
35
55
|
|
|
36
56
|
/**
|
|
37
|
-
* Inflects
|
|
57
|
+
* Inflects an anthroponym in ablative grammatical case.
|
|
58
|
+
*
|
|
59
|
+
* @throws {TypeError} Input validation error.
|
|
38
60
|
*/
|
|
39
|
-
export function inAblative(
|
|
40
|
-
|
|
41
|
-
return anthroponymInflector.inflect(
|
|
61
|
+
export async function inAblative(input: DeclensionInput): Promise<DeclensionOutput> {
|
|
62
|
+
validateDeclensionInput(input);
|
|
63
|
+
return anthroponymInflector.inflect(input, input.gender, GrammaticalCase.ABLATIVE);
|
|
42
64
|
}
|
|
43
65
|
|
|
44
66
|
/**
|
|
45
|
-
* Inflects
|
|
67
|
+
* Inflects an anthroponym in locative grammatical case.
|
|
68
|
+
*
|
|
69
|
+
* @throws {TypeError} Input validation error.
|
|
46
70
|
*/
|
|
47
|
-
export function inLocative(
|
|
48
|
-
|
|
49
|
-
return anthroponymInflector.inflect(
|
|
71
|
+
export async function inLocative(input: DeclensionInput): Promise<DeclensionOutput> {
|
|
72
|
+
validateDeclensionInput(input);
|
|
73
|
+
return anthroponymInflector.inflect(input, input.gender, GrammaticalCase.LOCATIVE);
|
|
50
74
|
}
|
|
51
75
|
|
|
52
76
|
/**
|
|
53
|
-
* Inflects
|
|
77
|
+
* Inflects an anthroponym in vocative grammatical case.
|
|
78
|
+
*
|
|
79
|
+
* @throws {TypeError} Input validation error.
|
|
54
80
|
*/
|
|
55
|
-
export function inVocative(
|
|
56
|
-
|
|
57
|
-
return anthroponymInflector.inflect(
|
|
81
|
+
export async function inVocative(input: DeclensionInput): Promise<DeclensionOutput> {
|
|
82
|
+
validateDeclensionInput(input);
|
|
83
|
+
return anthroponymInflector.inflect(input, input.gender, GrammaticalCase.VOCATIVE);
|
|
58
84
|
}
|
|
59
85
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
86
|
+
/**
|
|
87
|
+
* Returns the grammatical gender of an anthroponym.
|
|
88
|
+
* Returns null if the grammatical gender cannot be detected.
|
|
89
|
+
*
|
|
90
|
+
* @throws {TypeError} Input validation error.
|
|
91
|
+
*/
|
|
92
|
+
export async function detectGender(input: GenderDetectionInput): Promise<GenderDetectionOutput> {
|
|
93
|
+
validateGenderDetectionInput(input);
|
|
94
|
+
return autoDetectGender(input);
|
|
95
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# Word Class Recoginition Module
|
|
2
|
+
|
|
3
|
+
This module implements part of speech (also known as word class) recognition of Ukrainian family names.
|
|
4
|
+
|
|
5
|
+
The word class recognition is performed by [TensorFlow](https://www.tensorflow.org/js) model trained on more than 40K Ukrainian family names. The dataset consists of feminine family names ending in `-a`, `-я` and masculine family names ending in `-их`, `-ой`, `-ий`, `-ій`.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"modelInfo": {"dateSaved":"2023-02-16T00:14:42.753Z","modelTopologyType":"JSON","modelTopologyBytes":1659,"weightSpecsBytes":428,"weightDataBytes":4356},
|
|
3
|
+
"modelMetadata": {"format":"layers-model","generatedBy":"TensorFlow.js tfjs-layers v4.2.0","convertedBy":null},
|
|
4
|
+
"modelTopology": {"class_name":"Sequential","config":{"name":"sequential_1","layers":[{"class_name":"Embedding","config":{"input_dim":34,"output_dim":16,"embeddings_initializer":{"class_name":"RandomUniform","config":{"minval":-0.05,"maxval":0.05,"seed":null}},"embeddings_regularizer":null,"activity_regularizer":null,"embeddings_constraint":null,"mask_zero":null,"input_length":null,"name":"embedding_Embedding1","trainable":true,"batch_input_shape":[null,null]}},{"class_name":"SimpleRNN","config":{"name":"simple_rnn_SimpleRNN1","trainable":true,"units":16,"activation":"relu","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"recurrent_initializer":{"class_name":"Orthogonal","config":{"gain":1,"seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"recurrent_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"recurrent_constraint":null,"bias_constraint":null,"dropout":0,"recurrent_dropout":0,"return_sequences":false,"return_state":false,"go_backwards":false,"stateful":false,"unroll":false}},{"class_name":"Dense","config":{"units":1,"activation":"sigmoid","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense1","trainable":true}}]},"keras_version":"tfjs-layers 4.2.0","backend":"tensor_flow.js"},
|
|
5
|
+
"weightSpecs": [{"name":"embedding_Embedding1/embeddings","shape":[34,16],"dtype":"float32"},{"name":"simple_rnn_SimpleRNN1/kernel","shape":[16,16],"dtype":"float32"},{"name":"simple_rnn_SimpleRNN1/recurrent_kernel","shape":[16,16],"dtype":"float32"},{"name":"simple_rnn_SimpleRNN1/bias","shape":[16],"dtype":"float32"},{"name":"dense_Dense1/kernel","shape":[16,1],"dtype":"float32"},{"name":"dense_Dense1/bias","shape":[1],"dtype":"float32"}],
|
|
6
|
+
"weightData": "Rev2O4TTez1kUwc88DqSvNfOwbwpkKa968xWvRNKmr2N4+A8hyCoPY6JdL3vIBs9qHocvU8CGT17MHS7HhBEPKUmuL3r0yY+aEMgPlNqtr4pr2e9M7vSvNTd4zxNxx4+LQ8LPuaMxLzwOrk9RC9EPFuAP73UrYG+b92fPhBUSj1cUfc9/ndWvsEEGb0RBXA+QhOjPByI1D1vhl4+LoeyvZ7vyL0TDXs91DjUvUTsDT65EvE9dIFlPvW0jr7cSJg9IXfivds5Wj532Bg+pMwTvmfIT72XqOK9i8wzvklY4z1bQ2k+hPk1vrsK1z36Mzm+FXuHPf1IB75bUEs+8uJrvpF3ND4MPdK9nOM1PWNHVz4v+mI+ErWJPdJBQD5bf5y+8X9ovVknEz6rQD2+IF+SPenzGD5+p2M+dJluvnAnGz5gEIO9qj0WPVSooz3Y14i828MVPvTcJ7yenHw8VqWjPRbm77xfGps8SdZEvRTk7T0PykI8U7O/Pcd+3L0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equential","config":{"name":"sequential_1","layers":[{"class_name":"Embedding","config":{"input_dim":34,"output_dim":16,"embeddings_initializer":{"class_name":"RandomUniform","config":{"minval":-0.05,"maxval":0.05,"seed":null}},"embeddings_regularizer":null,"activity_regularizer":null,"embeddings_constraint":null,"mask_zero":null,"input_length":null,"name":"embedding_Embedding1","trainable":true,"batch_input_shape":[null,null]}},{"class_name":"SimpleRNN","config":{"name":"simple_rnn_SimpleRNN1","trainable":true,"units":16,"activation":"relu","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"recurrent_initializer":{"class_name":"Orthogonal","config":{"gain":1,"seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"recurrent_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"recurrent_constraint":null,"bias_constraint":null,"dropout":0,"recurrent_dropout":0,"return_sequences":false,"return_state":false,"go_backwards":false,"stateful":false,"unroll":false}},{"class_name":"Dense","config":{"units":1,"activation":"sigmoid","use_bias":true,"kernel_initializer":{"class_name":"VarianceScaling","config":{"scale":1,"mode":"fan_avg","distribution":"normal","seed":null}},"bias_initializer":{"class_name":"Zeros","config":{}},"kernel_regularizer":null,"bias_regularizer":null,"activity_regularizer":null,"kernel_constraint":null,"bias_constraint":null,"name":"dense_Dense1","trainable":true}}]},"keras_version":"tfjs-layers 4.2.0","backend":"tensor_flow.js"},"weightsManifest":[{"paths":["weights.bin"],"weights":[{"name":"embedding_Embedding1/embeddings","shape":[34,16],"dtype":"float32"},{"name":"simple_rnn_SimpleRNN1/kernel","shape":[16,16],"dtype":"float32"},{"name":"simple_rnn_SimpleRNN1/recurrent_kernel","shape":[16,16],"dtype":"float32"},{"name":"simple_rnn_SimpleRNN1/bias","shape":[16],"dtype":"float32"},{"name":"dense_Dense1/kernel","shape":[16,1],"dtype":"float32"},{"name":"dense_Dense1/bias","shape":[1],"dtype":"float32"}]}],"format":"layers-model","generatedBy":"TensorFlow.js tfjs-layers v4.2.0","convertedBy":null}
|
|
Binary file
|