shevchenko 3.1.0-alpha.6 → 3.1.1
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/README.md +8 -0
- package/dist/cjs/anthroponym-declension/anthroponym-inflector.js +1 -3
- package/dist/cjs/anthroponym-declension/bootstrap.js +1 -3
- package/dist/cjs/anthroponym-declension/family-name-classifier/artifacts/model.bundle.json.js +2 -2
- package/dist/cjs/anthroponym-declension/family-name-classifier/cache/incorrect-predictions.json.js +4 -2
- package/dist/cjs/anthroponym-declension/family-name-classifier/family-name-class-transformer.js +1 -3
- package/dist/cjs/anthroponym-declension/family-name-classifier/family-name-classifer.js +5 -8
- package/dist/cjs/anthroponym-declension/family-name-classifier/model-bundle-loader.js +6 -8
- package/dist/cjs/anthroponym-declension/family-name-classifier/model-config.js +1 -3
- package/dist/cjs/anthroponym-declension/family-name-classifier/word-transformer.js +1 -3
- package/dist/cjs/anthroponym-declension/family-name-inflector.js +1 -3
- package/dist/cjs/anthroponym-declension/given-name-inflector.js +1 -3
- package/dist/cjs/anthroponym-declension/name-inflector.js +1 -3
- package/dist/cjs/anthroponym-declension/patronymic-name-inflector.js +1 -3
- package/dist/cjs/extension.js +1 -3
- package/dist/cjs/gender-detection/detect-gender.js +2 -4
- package/dist/cjs/gender-detection/given-names-genders.json.js +4 -2
- package/dist/cjs/index.js +4 -6
- package/dist/cjs/input-validation.js +3 -5
- package/dist/cjs/language/alphabet.js +1 -3
- package/dist/cjs/language/grammatical-case.js +1 -3
- package/dist/cjs/language/grammatical-gender.js +1 -3
- package/dist/cjs/language/letter-case.js +1 -3
- package/dist/cjs/language/linguistics.js +1 -3
- package/dist/cjs/language/word-class.js +1 -3
- package/dist/cjs/shevchenko.js +4 -6
- package/dist/cjs/word-declension/append-command-runner.js +1 -3
- package/dist/cjs/word-declension/bootstrap.js +2 -4
- package/dist/cjs/word-declension/command-runner-factory.js +1 -3
- package/dist/cjs/word-declension/declension-rule-inflector.js +1 -3
- package/dist/cjs/word-declension/declension-types.js +1 -3
- package/dist/cjs/word-declension/replace-command-runner.js +1 -3
- package/dist/cjs/word-declension/rules/artifacts/declension-rules.json.js +86 -3
- package/dist/cjs/word-declension/word-inflector.js +1 -3
- package/dist/es/anthroponym-declension/anthroponym-inflector.js +1 -1
- package/dist/es/anthroponym-declension/bootstrap.js +1 -1
- package/dist/es/anthroponym-declension/family-name-classifier/artifacts/model.bundle.json.js +1 -1
- package/dist/es/anthroponym-declension/family-name-classifier/cache/incorrect-predictions.json.js +1 -1
- package/dist/es/anthroponym-declension/family-name-classifier/family-name-class-transformer.js +1 -1
- package/dist/es/anthroponym-declension/family-name-classifier/family-name-classifer.js +1 -1
- package/dist/es/anthroponym-declension/family-name-classifier/model-bundle-loader.js +1 -1
- package/dist/es/anthroponym-declension/family-name-classifier/model-config.js +1 -1
- package/dist/es/anthroponym-declension/family-name-classifier/word-transformer.js +1 -1
- package/dist/es/anthroponym-declension/family-name-inflector.js +1 -1
- package/dist/es/anthroponym-declension/given-name-inflector.js +1 -1
- package/dist/es/anthroponym-declension/name-inflector.js +1 -1
- package/dist/es/anthroponym-declension/patronymic-name-inflector.js +1 -1
- package/dist/es/extension.js +1 -1
- package/dist/es/gender-detection/detect-gender.js +1 -1
- package/dist/es/gender-detection/given-names-genders.json.js +1 -1
- package/dist/es/index.js +1 -1
- package/dist/es/input-validation.js +3 -3
- package/dist/es/language/alphabet.js +1 -1
- package/dist/es/language/grammatical-case.js +1 -1
- package/dist/es/language/grammatical-gender.js +1 -1
- package/dist/es/language/letter-case.js +1 -1
- package/dist/es/language/linguistics.js +1 -1
- package/dist/es/language/word-class.js +1 -1
- package/dist/es/shevchenko.js +2 -3
- package/dist/es/word-declension/append-command-runner.js +1 -1
- package/dist/es/word-declension/bootstrap.js +1 -1
- package/dist/es/word-declension/command-runner-factory.js +1 -1
- package/dist/es/word-declension/declension-rule-inflector.js +1 -1
- package/dist/es/word-declension/declension-types.js +1 -1
- package/dist/es/word-declension/replace-command-runner.js +1 -1
- package/dist/es/word-declension/rules/artifacts/declension-rules.json.js +83 -2
- package/dist/es/word-declension/word-inflector.js +1 -1
- package/dist/umd/shevchenko.min.js +305 -386
- package/package.json +9 -9
package/README.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
JavaScript library for declension of Ukrainian anthroponyms.
|
|
4
4
|
|
|
5
|
+
[](https://github.com/tooleks/shevchenko-js/releases)
|
|
6
|
+
[](https://www.npmjs.com/package/shevchenko)
|
|
7
|
+
[](https://hub.docker.com/r/tooleks/shevchenko)
|
|
8
|
+
|
|
5
9
|
## Links
|
|
6
10
|
|
|
7
11
|
* [Try it out](https://shevchenko-js.tooleks.com/en-US) / [Демонстрація](https://shevchenko-js.tooleks.com)
|
|
@@ -10,6 +14,10 @@ JavaScript library for declension of Ukrainian anthroponyms.
|
|
|
10
14
|
* [License](https://github.com/tooleks/shevchenko-js/blob/main/LICENSE)
|
|
11
15
|
* [Migration Guide (v2 → v3)](https://github.com/tooleks/shevchenko-js/wiki/Migration-Guide)
|
|
12
16
|
|
|
17
|
+
## Extensions
|
|
18
|
+
|
|
19
|
+
* [Military extension](https://github.com/tooleks/shevchenko-ext-military) - declension of Ukrainian military ranks and appointments
|
|
20
|
+
|
|
13
21
|
## User Guide
|
|
14
22
|
|
|
15
23
|
### Installation
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
class AnthroponymInflector {
|
|
15
13
|
constructor(givenNameInflector, patronymicNameInflector, familyNameInflector) {
|
|
16
14
|
this.givenNameInflector = givenNameInflector;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
var bootstrap = require('../word-declension/bootstrap.js');
|
|
15
13
|
var anthroponymInflector$1 = require('./anthroponym-inflector.js');
|
|
16
14
|
var familyNameClassifer = require('./family-name-classifier/family-name-classifer.js');
|
package/dist/cjs/anthroponym-declension/family-name-classifier/artifacts/model.bundle.json.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.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -190,7 +190,7 @@ var modelBundle = {
|
|
|
190
190
|
modelMetadata: modelMetadata
|
|
191
191
|
};
|
|
192
192
|
|
|
193
|
-
exports
|
|
193
|
+
exports.default = modelBundle;
|
|
194
194
|
exports.modelInfo = modelInfo;
|
|
195
195
|
exports.modelMetadata = modelMetadata;
|
|
196
196
|
exports.modelTopology = modelTopology;
|
package/dist/cjs/anthroponym-declension/family-name-classifier/cache/incorrect-predictions.json.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.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
+
|
|
12
14
|
var incorrectPredictionsCache = {
|
|
13
15
|
"штих": "noun",
|
|
14
16
|
"пяних": "noun",
|
|
@@ -1156,4 +1158,4 @@ var incorrectPredictionsCache = {
|
|
|
1156
1158
|
"панібудьласка": "noun"
|
|
1157
1159
|
};
|
|
1158
1160
|
|
|
1159
|
-
|
|
1161
|
+
exports.default = incorrectPredictionsCache;
|
package/dist/cjs/anthroponym-declension/family-name-classifier/family-name-class-transformer.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.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
require('../../language/alphabet.js');
|
|
15
13
|
var wordClass = require('../../language/word-class.js');
|
|
16
14
|
require('../../language/grammatical-case.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,16 +9,13 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
var tf = require('@tensorflow/tfjs');
|
|
15
13
|
var incorrectPredictions = require('./cache/incorrect-predictions.json.js');
|
|
16
14
|
var familyNameClassTransformer = require('./family-name-class-transformer.js');
|
|
17
15
|
var modelConfig = require('./model-config.js');
|
|
18
16
|
var wordTransformer = require('./word-transformer.js');
|
|
19
17
|
|
|
20
|
-
function
|
|
21
|
-
if (e && e.__esModule) return e;
|
|
18
|
+
function _interopNamespaceDefault(e) {
|
|
22
19
|
var n = Object.create(null);
|
|
23
20
|
if (e) {
|
|
24
21
|
Object.keys(e).forEach(function (k) {
|
|
@@ -31,11 +28,11 @@ function _interopNamespace(e) {
|
|
|
31
28
|
}
|
|
32
29
|
});
|
|
33
30
|
}
|
|
34
|
-
n
|
|
31
|
+
n.default = e;
|
|
35
32
|
return Object.freeze(n);
|
|
36
33
|
}
|
|
37
34
|
|
|
38
|
-
var tf__namespace = /*#__PURE__*/
|
|
35
|
+
var tf__namespace = /*#__PURE__*/_interopNamespaceDefault(tf);
|
|
39
36
|
|
|
40
37
|
// Disable Node.js environment warning message in production code.
|
|
41
38
|
// See https://github.com/tensorflow/tfjs/issues/5349
|
|
@@ -66,7 +63,7 @@ class FamilyNameClassifier {
|
|
|
66
63
|
*/
|
|
67
64
|
getCached(familyName) {
|
|
68
65
|
let familyNameClass = null;
|
|
69
|
-
const wordClass = incorrectPredictions[familyName.toLowerCase()];
|
|
66
|
+
const wordClass = incorrectPredictions.default[familyName.toLowerCase()];
|
|
70
67
|
if (wordClass) {
|
|
71
68
|
familyNameClass = { wordClass };
|
|
72
69
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
var model_bundle = require('./artifacts/model.bundle.json.js');
|
|
15
13
|
|
|
16
14
|
// Use Buffer on Node.js instead of Blob/atob/btoa
|
|
@@ -41,11 +39,11 @@ class ModelBundleLoader {
|
|
|
41
39
|
*/
|
|
42
40
|
async load() {
|
|
43
41
|
const out = {};
|
|
44
|
-
out.modelTopology = model_bundle
|
|
45
|
-
out.weightSpecs = model_bundle
|
|
46
|
-
out.weightData = base64StringToArrayBuffer(model_bundle
|
|
47
|
-
if (model_bundle
|
|
48
|
-
const metadata = model_bundle
|
|
42
|
+
out.modelTopology = model_bundle.default.modelTopology;
|
|
43
|
+
out.weightSpecs = model_bundle.default.weightSpecs;
|
|
44
|
+
out.weightData = base64StringToArrayBuffer(model_bundle.default.weightData);
|
|
45
|
+
if (model_bundle.default.modelMetadata != null) {
|
|
46
|
+
const metadata = model_bundle.default.modelMetadata;
|
|
49
47
|
out.format = metadata.format;
|
|
50
48
|
out.generatedBy = metadata.generatedBy;
|
|
51
49
|
out.convertedBy = metadata.convertedBy;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
/**
|
|
15
13
|
* The size of the model input vector.
|
|
16
14
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
var alphabet = require('../../language/alphabet.js');
|
|
15
13
|
require('../../language/word-class.js');
|
|
16
14
|
require('../../language/grammatical-case.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
require('../language/alphabet.js');
|
|
15
13
|
require('../language/word-class.js');
|
|
16
14
|
var linguistics = require('../language/linguistics.js');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
var nameInflector = require('./name-inflector.js');
|
|
15
13
|
|
|
16
14
|
class GivenNameInflector extends nameInflector.NameInflector {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
class NameInflector {
|
|
15
13
|
/**
|
|
16
14
|
* Inflects the name in the given grammatical case.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
var nameInflector = require('./name-inflector.js');
|
|
15
13
|
|
|
16
14
|
class PatronymicNameInflector extends nameInflector.NameInflector {
|
package/dist/cjs/extension.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.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
var bootstrap = require('./word-declension/bootstrap.js');
|
|
15
13
|
|
|
16
14
|
const registeredExtensions = [];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
require('../language/alphabet.js');
|
|
15
13
|
require('../language/word-class.js');
|
|
16
14
|
require('../language/grammatical-case.js');
|
|
@@ -41,7 +39,7 @@ function detectGender(anthroponym) {
|
|
|
41
39
|
const givenName = anthroponym.givenName
|
|
42
40
|
.replace(APOSTROPHE_VARIATION_PATTERN, "'")
|
|
43
41
|
.toLocaleLowerCase();
|
|
44
|
-
const gender = givenNamesGenders[givenName];
|
|
42
|
+
const gender = givenNamesGenders.default[givenName];
|
|
45
43
|
if (gender != null) {
|
|
46
44
|
return gender;
|
|
47
45
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
+
|
|
12
14
|
var givenNamesGenders = {
|
|
13
15
|
"августа": "feminine",
|
|
14
16
|
"аврелія": "feminine",
|
|
@@ -1154,4 +1156,4 @@ var givenNamesGenders = {
|
|
|
1154
1156
|
"яснолик": "masculine"
|
|
1155
1157
|
};
|
|
1156
1158
|
|
|
1157
|
-
|
|
1159
|
+
exports.default = givenNamesGenders;
|
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.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
var shevchenko = require('./shevchenko.js');
|
|
15
13
|
var inputValidation = require('./input-validation.js');
|
|
16
14
|
var grammaticalCase = require('./language/grammatical-case.js');
|
|
@@ -30,15 +28,15 @@ exports.inLocative = shevchenko.inLocative;
|
|
|
30
28
|
exports.inNominative = shevchenko.inNominative;
|
|
31
29
|
exports.inVocative = shevchenko.inVocative;
|
|
32
30
|
exports.InputValidationError = inputValidation.InputValidationError;
|
|
33
|
-
Object.defineProperty(exports,
|
|
31
|
+
Object.defineProperty(exports, "GrammaticalCase", {
|
|
34
32
|
enumerable: true,
|
|
35
33
|
get: function () { return grammaticalCase.GrammaticalCase; }
|
|
36
34
|
});
|
|
37
|
-
Object.defineProperty(exports,
|
|
35
|
+
Object.defineProperty(exports, "GrammaticalGender", {
|
|
38
36
|
enumerable: true,
|
|
39
37
|
get: function () { return grammaticalGender.GrammaticalGender; }
|
|
40
38
|
});
|
|
41
|
-
Object.defineProperty(exports,
|
|
39
|
+
Object.defineProperty(exports, "WordClass", {
|
|
42
40
|
enumerable: true,
|
|
43
41
|
get: function () { return wordClass.WordClass; }
|
|
44
42
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
var extension = require('./extension.js');
|
|
15
13
|
require('./language/alphabet.js');
|
|
16
14
|
require('./language/word-class.js');
|
|
@@ -40,7 +38,7 @@ function validateDeclensionInput(input) {
|
|
|
40
38
|
throw new InputValidationError(`At least one of the following parameters must present: "${mergedFieldNames.join('", "')}".`);
|
|
41
39
|
}
|
|
42
40
|
for (const fieldName of mergedFieldNames) {
|
|
43
|
-
if (fieldName
|
|
41
|
+
if (typeof input[fieldName] !== 'undefined' && typeof input[fieldName] !== 'string') {
|
|
44
42
|
throw new InputValidationError(`The "${fieldName}" parameter must be a string.`);
|
|
45
43
|
}
|
|
46
44
|
}
|
|
@@ -59,7 +57,7 @@ function validateGenderDetectionInput(input) {
|
|
|
59
57
|
throw new InputValidationError(`At least one of the following parameters must present: "${fieldNames.join('", "')}".`);
|
|
60
58
|
}
|
|
61
59
|
for (const fieldName of fieldNames) {
|
|
62
|
-
if (fieldName
|
|
60
|
+
if (typeof input[fieldName] !== 'undefined' && typeof input[fieldName] !== 'string') {
|
|
63
61
|
throw new InputValidationError(`The "${fieldName}" parameter must be a string.`);
|
|
64
62
|
}
|
|
65
63
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
/**
|
|
15
13
|
* Ukrainian alphabet encoding where the key is the letter of the alphabet
|
|
16
14
|
* and the value is the order number of the corresponding letter starting from 1.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
/**
|
|
15
13
|
* Enum representing the possible grammatical cases.
|
|
16
14
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
/**
|
|
15
13
|
* Enum representing the possible grammatical genders.
|
|
16
14
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
/**
|
|
15
13
|
* Copies a letter case pattern from a template word to a target word.
|
|
16
14
|
* Returns a modified target word in the letter case of the template word.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
const PATTERN_VOWELS = /[аоуеиіяюєї]/gi;
|
|
15
13
|
/**
|
|
16
14
|
* Returns a number of syllables in a 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.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
/**
|
|
15
13
|
* Enum representing the possible grammatical word classes (also known as part of speech).
|
|
16
14
|
*/
|
package/dist/cjs/shevchenko.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.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
var bootstrap = require('./anthroponym-declension/bootstrap.js');
|
|
15
13
|
var extension = require('./extension.js');
|
|
16
14
|
var detectGender$1 = require('./gender-detection/detect-gender.js');
|
|
@@ -172,15 +170,15 @@ async function detectGender(input) {
|
|
|
172
170
|
|
|
173
171
|
exports.registerExtension = extension.registerExtension;
|
|
174
172
|
exports.InputValidationError = inputValidation.InputValidationError;
|
|
175
|
-
Object.defineProperty(exports,
|
|
173
|
+
Object.defineProperty(exports, "WordClass", {
|
|
176
174
|
enumerable: true,
|
|
177
175
|
get: function () { return wordClass.WordClass; }
|
|
178
176
|
});
|
|
179
|
-
Object.defineProperty(exports,
|
|
177
|
+
Object.defineProperty(exports, "GrammaticalCase", {
|
|
180
178
|
enumerable: true,
|
|
181
179
|
get: function () { return grammaticalCase.GrammaticalCase; }
|
|
182
180
|
});
|
|
183
|
-
Object.defineProperty(exports,
|
|
181
|
+
Object.defineProperty(exports, "GrammaticalGender", {
|
|
184
182
|
enumerable: true,
|
|
185
183
|
get: function () { return grammaticalGender.GrammaticalGender; }
|
|
186
184
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,8 +9,6 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
class AppendCommandRunner {
|
|
15
13
|
constructor(command) {
|
|
16
14
|
this.command = command;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file JavaScript library for declension of Ukrainian anthroponyms
|
|
3
3
|
* @module shevchenko
|
|
4
|
-
* @version 3.1.
|
|
4
|
+
* @version 3.1.1
|
|
5
5
|
* @author Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2017-2024 Oleksandr Tolochko <shevchenko-js@tooleks.com>
|
|
@@ -9,11 +9,9 @@
|
|
|
9
9
|
*/
|
|
10
10
|
'use strict';
|
|
11
11
|
|
|
12
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
13
|
-
|
|
14
12
|
var declensionRules = require('./rules/artifacts/declension-rules.json.js');
|
|
15
13
|
var wordInflector$1 = require('./word-inflector.js');
|
|
16
14
|
|
|
17
|
-
const wordInflector = new wordInflector$1.WordInflector(declensionRules);
|
|
15
|
+
const wordInflector = new wordInflector$1.WordInflector(declensionRules.default);
|
|
18
16
|
|
|
19
17
|
exports.wordInflector = wordInflector;
|