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.
Files changed (69) hide show
  1. package/README.md +6 -6
  2. package/dist/cjs/shevchenko.js +32 -33
  3. package/dist/cjs/shevchenko.js.map +1 -1
  4. package/dist/es/shevchenko.js +27 -27
  5. package/dist/es/shevchenko.js.map +1 -1
  6. package/dist/types/anthroponym-inflection/anthroponym-inflector.d.ts +1 -1
  7. package/dist/types/anthroponym-inflection/append-command-runner.d.ts +1 -1
  8. package/dist/types/anthroponym-inflection/command-runner-factory.d.ts +1 -1
  9. package/dist/types/anthroponym-inflection/name-inflector.d.ts +2 -2
  10. package/dist/types/anthroponym-inflection/replace-command-runner.d.ts +1 -1
  11. package/dist/types/anthroponym-inflection/rule-inflector.d.ts +1 -1
  12. package/dist/types/part-of-speech-recognition/neural-network.d.ts +3 -3
  13. package/dist/types/part-of-speech-recognition/part-of-speech-recognition-rule.d.ts +2 -2
  14. package/dist/types/part-of-speech-recognition/part-of-speech-recognizer.d.ts +2 -2
  15. package/dist/types/part-of-speech-recognition/word-transformer.d.ts +1 -1
  16. package/dist/types/shevchenko.d.ts +9 -8
  17. package/dist/types/shevchenko.d.ts.map +1 -1
  18. package/dist/types/utils/lang.utils.d.ts +1 -1
  19. package/dist/types/utils/regexp.utils.d.ts +1 -1
  20. package/dist/umd/shevchenko.min.js +5 -5
  21. package/dist/umd/shevchenko.min.js.map +1 -1
  22. package/package.json +16 -12
  23. package/src/anthroponym-inflection/anthroponym-inflector.ts +38 -0
  24. package/src/anthroponym-inflection/append-command-runner.ts +18 -0
  25. package/src/anthroponym-inflection/command-runner-factory.ts +23 -0
  26. package/src/anthroponym-inflection/first-name-inflector.ts +41 -0
  27. package/src/anthroponym-inflection/index.ts +5 -0
  28. package/src/anthroponym-inflection/inflector-command-runner.ts +3 -0
  29. package/src/anthroponym-inflection/inflector.types.ts +42 -0
  30. package/src/anthroponym-inflection/last-name-inflector.ts +54 -0
  31. package/src/anthroponym-inflection/middle-name-inflector.ts +29 -0
  32. package/src/anthroponym-inflection/name-inflector.ts +19 -0
  33. package/src/anthroponym-inflection/replace-command-runner.ts +18 -0
  34. package/src/anthroponym-inflection/rule-inflector.ts +40 -0
  35. package/src/bootstrap.ts +53 -0
  36. package/src/core/anthroponym.interface.ts +8 -0
  37. package/src/core/gender.enum.ts +4 -0
  38. package/src/core/grammatical-case.enum.ts +9 -0
  39. package/src/core/index.ts +4 -0
  40. package/src/core/validator.ts +39 -0
  41. package/src/internal.ts +1 -0
  42. package/src/part-of-speech-recognition/index.ts +5 -0
  43. package/src/part-of-speech-recognition/neural-network-config.ts +5 -0
  44. package/src/part-of-speech-recognition/neural-network-training-data.ts +5 -0
  45. package/src/part-of-speech-recognition/neural-network.ts +66 -0
  46. package/src/part-of-speech-recognition/part-of-speech-decoder.ts +26 -0
  47. package/src/part-of-speech-recognition/part-of-speech-encoder.ts +20 -0
  48. package/src/part-of-speech-recognition/part-of-speech-recognition-rule.ts +33 -0
  49. package/src/part-of-speech-recognition/part-of-speech-recognizer.ts +26 -0
  50. package/src/part-of-speech-recognition/part-of-speech.enum.ts +4 -0
  51. package/src/part-of-speech-recognition/word-encoder.ts +23 -0
  52. package/src/part-of-speech-recognition/word-transformer.ts +8 -0
  53. package/src/resources/inflector/rules.json +7114 -0
  54. package/src/resources/neural-networks/kosmii/README.md +5 -0
  55. package/src/resources/neural-networks/kosmii/cache.json +8 -0
  56. package/src/resources/neural-networks/kosmii/samples.json +9435 -0
  57. package/src/resources/neural-networks/kosmii/structure.json +47898 -0
  58. package/src/resources/neural-networks/pelykh/README.md +5 -0
  59. package/src/resources/neural-networks/pelykh/cache.json +1 -0
  60. package/src/resources/neural-networks/pelykh/samples.json +221 -0
  61. package/src/resources/neural-networks/pelykh/structure.json +47898 -0
  62. package/src/resources/neural-networks/pohorielova/README.md +5 -0
  63. package/src/resources/neural-networks/pohorielova/cache.json +542 -0
  64. package/src/resources/neural-networks/pohorielova/samples.json +32147 -0
  65. package/src/resources/neural-networks/pohorielova/structure.json +47898 -0
  66. package/src/shevchenko.ts +63 -0
  67. package/src/utils/lang.utils.ts +13 -0
  68. package/src/utils/regexp.utils.ts +11 -0
  69. 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 a given anthroponym in a given grammatical case.
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 a given value.
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 a given command.
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 a given name in a given grammatical case.
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 a given word of the compound name in a given grammatical case.
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 a given value with the command value.
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 a given word in a given grammatical case using the rule.
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 a given training data.
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 a given word.
24
- * Returns a part of speech of a given word.
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 a given word.
15
- * Returns a part of speech of a given word.
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 a given word.
9
- * Returns part of speech of a given word.
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,6 +1,6 @@
1
1
  export declare class WordTransformer {
2
2
  /**
3
- * Transform a given word for use in part of speech recognition process.
3
+ * Transform the given word for use in part of speech recognition process.
4
4
  */
5
5
  transform(word: string): string;
6
6
  }
@@ -1,31 +1,32 @@
1
- import { Anthroponym } from './core';
1
+ import { Anthroponym, Gender } from './core';
2
2
  /**
3
- * Inflects an anthroponym in nominative grammatical case.
3
+ * Inflects the anthroponym in nominative grammatical case.
4
4
  */
5
5
  export declare function inNominative(anthroponym: Anthroponym): Anthroponym;
6
6
  /**
7
- * Inflects an anthroponym in genitive grammatical case.
7
+ * Inflects the anthroponym in genitive grammatical case.
8
8
  */
9
9
  export declare function inGenitive(anthroponym: Anthroponym): Anthroponym;
10
10
  /**
11
- * Inflects an anthroponym in dative grammatical case.
11
+ * Inflects the anthroponym in dative grammatical case.
12
12
  */
13
13
  export declare function inDative(anthroponym: Anthroponym): Anthroponym;
14
14
  /**
15
- * Inflects an anthroponym in accusative grammatical case.
15
+ * Inflects the anthroponym in accusative grammatical case.
16
16
  */
17
17
  export declare function inAccusative(anthroponym: Anthroponym): Anthroponym;
18
18
  /**
19
- * Inflects an anthroponym in ablative grammatical case.
19
+ * Inflects the anthroponym in ablative grammatical case.
20
20
  */
21
21
  export declare function inAblative(anthroponym: Anthroponym): Anthroponym;
22
22
  /**
23
- * Inflects an anthroponym in locative grammatical case.
23
+ * Inflects the anthroponym in locative grammatical case.
24
24
  */
25
25
  export declare function inLocative(anthroponym: Anthroponym): Anthroponym;
26
26
  /**
27
- * Inflects an anthroponym in vocative grammatical case.
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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AAgB,UAAU,CAAC,WAAW,EAAE,WAAW,GAAG,WAAW,CAGhE;AAED,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,CAAC;AAG/B,OAAO,KAAK,QAAQ,MAAM,YAAY,CAAC"}
@@ -1,6 +1,6 @@
1
1
  export declare const PATTERN_VOWELS: RegExp;
2
2
  /**
3
- * Counts vowel sounds in a given word.
3
+ * Counts vowel sounds in the given word.
4
4
  * Returns a number of vowels.
5
5
  */
6
6
  export declare function countVowels(word: string): number;
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Counts a number of groups in a given regular expression.
2
+ * Counts a number of groups in the given regular expression.
3
3
  */
4
4
  export declare function countGroups(src: RegExp | string): number;
5
5
  //# sourceMappingURL=regexp.utils.d.ts.map