shevchenko 2.0.6 → 2.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 +6 -6
- package/dist/cjs/shevchenko.js +32 -33
- package/dist/cjs/shevchenko.js.map +1 -1
- package/dist/es/shevchenko.js +27 -27
- package/dist/es/shevchenko.js.map +1 -1
- package/dist/types/anthroponym-inflection/anthroponym-inflector.d.ts +1 -1
- package/dist/types/anthroponym-inflection/append-command-runner.d.ts +1 -1
- package/dist/types/anthroponym-inflection/command-runner-factory.d.ts +1 -1
- package/dist/types/anthroponym-inflection/name-inflector.d.ts +2 -2
- package/dist/types/anthroponym-inflection/replace-command-runner.d.ts +1 -1
- package/dist/types/anthroponym-inflection/rule-inflector.d.ts +1 -1
- package/dist/types/part-of-speech-recognition/neural-network.d.ts +3 -3
- package/dist/types/part-of-speech-recognition/part-of-speech-recognition-rule.d.ts +2 -2
- package/dist/types/part-of-speech-recognition/part-of-speech-recognizer.d.ts +2 -2
- package/dist/types/part-of-speech-recognition/word-transformer.d.ts +1 -1
- package/dist/types/shevchenko.d.ts +9 -8
- package/dist/types/shevchenko.d.ts.map +1 -1
- package/dist/types/utils/lang.utils.d.ts +1 -1
- package/dist/types/utils/regexp.utils.d.ts +1 -1
- package/dist/umd/shevchenko.min.js +5 -5
- package/dist/umd/shevchenko.min.js.map +1 -1
- package/package.json +16 -12
- package/src/anthroponym-inflection/anthroponym-inflector.ts +38 -0
- package/src/anthroponym-inflection/append-command-runner.ts +18 -0
- package/src/anthroponym-inflection/command-runner-factory.ts +23 -0
- package/src/anthroponym-inflection/first-name-inflector.ts +41 -0
- package/src/anthroponym-inflection/index.ts +5 -0
- package/src/anthroponym-inflection/inflector-command-runner.ts +3 -0
- package/src/anthroponym-inflection/inflector.types.ts +42 -0
- package/src/anthroponym-inflection/last-name-inflector.ts +54 -0
- package/src/anthroponym-inflection/middle-name-inflector.ts +29 -0
- package/src/anthroponym-inflection/name-inflector.ts +19 -0
- package/src/anthroponym-inflection/replace-command-runner.ts +18 -0
- package/src/anthroponym-inflection/rule-inflector.ts +40 -0
- package/src/bootstrap.ts +53 -0
- package/src/core/anthroponym.interface.ts +8 -0
- package/src/core/gender.enum.ts +4 -0
- package/src/core/grammatical-case.enum.ts +9 -0
- package/src/core/index.ts +4 -0
- package/src/core/validator.ts +39 -0
- package/src/internal.ts +1 -0
- package/src/part-of-speech-recognition/index.ts +5 -0
- package/src/part-of-speech-recognition/neural-network-config.ts +5 -0
- package/src/part-of-speech-recognition/neural-network-training-data.ts +5 -0
- package/src/part-of-speech-recognition/neural-network.ts +66 -0
- package/src/part-of-speech-recognition/part-of-speech-decoder.ts +26 -0
- package/src/part-of-speech-recognition/part-of-speech-encoder.ts +20 -0
- package/src/part-of-speech-recognition/part-of-speech-recognition-rule.ts +33 -0
- package/src/part-of-speech-recognition/part-of-speech-recognizer.ts +26 -0
- package/src/part-of-speech-recognition/part-of-speech.enum.ts +4 -0
- package/src/part-of-speech-recognition/word-encoder.ts +23 -0
- package/src/part-of-speech-recognition/word-transformer.ts +8 -0
- package/src/resources/inflector/rules.json +7114 -0
- package/src/resources/neural-networks/kosmii/README.md +5 -0
- package/src/resources/neural-networks/kosmii/cache.json +8 -0
- package/src/resources/neural-networks/kosmii/samples.json +9435 -0
- package/src/resources/neural-networks/kosmii/structure.json +47898 -0
- package/src/resources/neural-networks/pelykh/README.md +5 -0
- package/src/resources/neural-networks/pelykh/cache.json +1 -0
- package/src/resources/neural-networks/pelykh/samples.json +221 -0
- package/src/resources/neural-networks/pelykh/structure.json +47898 -0
- package/src/resources/neural-networks/pohorielova/README.md +5 -0
- package/src/resources/neural-networks/pohorielova/cache.json +542 -0
- package/src/resources/neural-networks/pohorielova/samples.json +32147 -0
- package/src/resources/neural-networks/pohorielova/structure.json +47898 -0
- package/src/shevchenko.ts +63 -0
- package/src/utils/lang.utils.ts +13 -0
- package/src/utils/regexp.utils.ts +11 -0
- package/src/utils/string.utils.ts +49 -0
|
@@ -8,7 +8,7 @@ export declare class AnthroponymInflector {
|
|
|
8
8
|
private readonly lastNameInflector;
|
|
9
9
|
constructor(firstNameInflector: FirstNameInflector, middleNameInflector: MiddleNameInflector, lastNameInflector: LastNameInflector);
|
|
10
10
|
/**
|
|
11
|
-
* Inflects
|
|
11
|
+
* Inflects the anthroponym in the given grammatical case.
|
|
12
12
|
*/
|
|
13
13
|
inflect(anthroponym: Anthroponym, grammaticalCase: GrammaticalCase): Anthroponym;
|
|
14
14
|
}
|
|
@@ -4,7 +4,7 @@ export declare class AppendCommandRunner implements InflectorCommandRunner {
|
|
|
4
4
|
private readonly command;
|
|
5
5
|
constructor(command: InflectorCommand);
|
|
6
6
|
/**
|
|
7
|
-
* Appends the command value to
|
|
7
|
+
* Appends the command value to the given value.
|
|
8
8
|
* Returns a new value.
|
|
9
9
|
*/
|
|
10
10
|
exec(value: string): string;
|
|
@@ -2,7 +2,7 @@ import { InflectorCommand } from './inflector.types';
|
|
|
2
2
|
import { InflectorCommandRunner } from './inflector-command-runner';
|
|
3
3
|
export declare class CommandRunnerFactory {
|
|
4
4
|
/**
|
|
5
|
-
* Creates a new command runner for
|
|
5
|
+
* Creates a new command runner for the given command.
|
|
6
6
|
*/
|
|
7
7
|
make(command: InflectorCommand): InflectorCommandRunner;
|
|
8
8
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Gender, GrammaticalCase } from '../core';
|
|
2
2
|
export declare abstract class NameInflector {
|
|
3
3
|
/**
|
|
4
|
-
* Inflects
|
|
4
|
+
* Inflects the name in the given grammatical case.
|
|
5
5
|
*/
|
|
6
6
|
inflect(name: string, gender: Gender, grammaticalCase: GrammaticalCase): string;
|
|
7
7
|
/**
|
|
8
|
-
* Inflects
|
|
8
|
+
* Inflects the word of the compound name in the given grammatical case.
|
|
9
9
|
*/
|
|
10
10
|
protected abstract inflectWord(word: string, gender: Gender, grammaticalCase: GrammaticalCase, isLastWord: boolean): string;
|
|
11
11
|
}
|
|
@@ -4,7 +4,7 @@ export declare class ReplaceCommandRunner implements InflectorCommandRunner {
|
|
|
4
4
|
private readonly command;
|
|
5
5
|
constructor(command: InflectorCommand);
|
|
6
6
|
/**
|
|
7
|
-
* Replaces
|
|
7
|
+
* Replaces the given value with the command value.
|
|
8
8
|
* Returns a new value.
|
|
9
9
|
*/
|
|
10
10
|
exec(value: string): string;
|
|
@@ -5,7 +5,7 @@ export declare class RuleInflector {
|
|
|
5
5
|
private readonly commandRunnerFactory;
|
|
6
6
|
constructor(rule: InflectorRule);
|
|
7
7
|
/**
|
|
8
|
-
* Inflects
|
|
8
|
+
* Inflects the given word in the given grammatical case using the rule.
|
|
9
9
|
*/
|
|
10
10
|
inflect(word: string, grammaticalCase: GrammaticalCase): string;
|
|
11
11
|
}
|
|
@@ -16,12 +16,12 @@ export declare class NeuralNetwork {
|
|
|
16
16
|
*/
|
|
17
17
|
toString(): string;
|
|
18
18
|
/**
|
|
19
|
-
* Trains the neural network using
|
|
19
|
+
* Trains the neural network using the given training data.
|
|
20
20
|
*/
|
|
21
21
|
train(trainingData: NeuralNetworkTrainingData, trainingOptions: any): NeuralNetwork;
|
|
22
22
|
/**
|
|
23
|
-
* Activates the neural network for
|
|
24
|
-
* Returns a part of speech of
|
|
23
|
+
* Activates the neural network for the given word.
|
|
24
|
+
* Returns a part of speech of the given word.
|
|
25
25
|
*/
|
|
26
26
|
activate(word: string): PartOfSpeech;
|
|
27
27
|
}
|
|
@@ -11,8 +11,8 @@ export declare class PartOfSpeechRecognitionRule {
|
|
|
11
11
|
private readonly neuralNetwork;
|
|
12
12
|
constructor(guard: PartOfSpeechRecognitionGuard, neuralNetwork: NeuralNetwork, cache: NeuralNetworkTrainingData);
|
|
13
13
|
/**
|
|
14
|
-
* Applies the part of speech recognizer rule to
|
|
15
|
-
* Returns a part of speech of
|
|
14
|
+
* Applies the part of speech recognizer rule to the given word.
|
|
15
|
+
* Returns a part of speech of the given word.
|
|
16
16
|
*/
|
|
17
17
|
apply(word: string): PartOfSpeech;
|
|
18
18
|
}
|
|
@@ -5,8 +5,8 @@ export declare class PartOfSpeechRecognizer {
|
|
|
5
5
|
private readonly rules;
|
|
6
6
|
constructor(rules: PartOfSpeechRecognitionRule[]);
|
|
7
7
|
/**
|
|
8
|
-
* Recognizes the part of speech of
|
|
9
|
-
* Returns part of speech of
|
|
8
|
+
* Recognizes the part of speech of the given word.
|
|
9
|
+
* Returns part of speech of the given word.
|
|
10
10
|
* Returns null if part of speech was not recognized.
|
|
11
11
|
*/
|
|
12
12
|
recognize(word: string, gender: Gender): PartOfSpeech | null;
|
|
@@ -1,31 +1,32 @@
|
|
|
1
|
-
import { Anthroponym } from './core';
|
|
1
|
+
import { Anthroponym, Gender } from './core';
|
|
2
2
|
/**
|
|
3
|
-
* Inflects
|
|
3
|
+
* Inflects the anthroponym in nominative grammatical case.
|
|
4
4
|
*/
|
|
5
5
|
export declare function inNominative(anthroponym: Anthroponym): Anthroponym;
|
|
6
6
|
/**
|
|
7
|
-
* Inflects
|
|
7
|
+
* Inflects the anthroponym in genitive grammatical case.
|
|
8
8
|
*/
|
|
9
9
|
export declare function inGenitive(anthroponym: Anthroponym): Anthroponym;
|
|
10
10
|
/**
|
|
11
|
-
* Inflects
|
|
11
|
+
* Inflects the anthroponym in dative grammatical case.
|
|
12
12
|
*/
|
|
13
13
|
export declare function inDative(anthroponym: Anthroponym): Anthroponym;
|
|
14
14
|
/**
|
|
15
|
-
* Inflects
|
|
15
|
+
* Inflects the anthroponym in accusative grammatical case.
|
|
16
16
|
*/
|
|
17
17
|
export declare function inAccusative(anthroponym: Anthroponym): Anthroponym;
|
|
18
18
|
/**
|
|
19
|
-
* Inflects
|
|
19
|
+
* Inflects the anthroponym in ablative grammatical case.
|
|
20
20
|
*/
|
|
21
21
|
export declare function inAblative(anthroponym: Anthroponym): Anthroponym;
|
|
22
22
|
/**
|
|
23
|
-
* Inflects
|
|
23
|
+
* Inflects the anthroponym in locative grammatical case.
|
|
24
24
|
*/
|
|
25
25
|
export declare function inLocative(anthroponym: Anthroponym): Anthroponym;
|
|
26
26
|
/**
|
|
27
|
-
* Inflects
|
|
27
|
+
* Inflects the anthroponym in vocative grammatical case.
|
|
28
28
|
*/
|
|
29
29
|
export declare function inVocative(anthroponym: Anthroponym): Anthroponym;
|
|
30
|
+
export { Anthroponym, Gender };
|
|
30
31
|
export * as Internal from './internal';
|
|
31
32
|
//# sourceMappingURL=shevchenko.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shevchenko.d.ts","sourceRoot":"","sources":["../../src/shevchenko.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAwC,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"shevchenko.d.ts","sourceRoot":"","sources":["../../src/shevchenko.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAwC,MAAM,QAAQ,CAAC;AAGnF;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAGlE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAGhE;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAG9D;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAGlE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAGhE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAGhE;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAGhE;AAED,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AAG/B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC"}
|