aboutsummaryrefslogtreecommitdiff
path: root/types
diff options
context:
space:
mode:
Diffstat (limited to 'types')
-rw-r--r--types/ext/dictionary.d.ts7
-rw-r--r--types/ext/language-transformer-internal.d.ts2
-rw-r--r--types/ext/language-transformer.d.ts4
-rw-r--r--types/ext/translation-internal.d.ts16
-rw-r--r--types/ext/translator.d.ts5
5 files changed, 26 insertions, 8 deletions
diff --git a/types/ext/dictionary.d.ts b/types/ext/dictionary.d.ts
index cc53ec0a..060e6907 100644
--- a/types/ext/dictionary.d.ts
+++ b/types/ext/dictionary.d.ts
@@ -258,7 +258,12 @@ export type InflectionRuleChainCandidate = {
inflectionRules: InflectionRuleChain;
};
-export type InflectionRuleChain = string[];
+export type InflectionRuleChain = InflectionRule[];
+
+export type InflectionRule = {
+ name: string;
+ description?: string;
+};
export type InflectionSource = 'algorithm' | 'dictionary' | 'both';
diff --git a/types/ext/language-transformer-internal.d.ts b/types/ext/language-transformer-internal.d.ts
index a2b18b35..c3ea4b7c 100644
--- a/types/ext/language-transformer-internal.d.ts
+++ b/types/ext/language-transformer-internal.d.ts
@@ -16,9 +16,11 @@
*/
export type Transform = {
+ id: string;
name: string;
rules: Rule[];
heuristic: RegExp;
+ description?: string;
};
export type Rule = {
diff --git a/types/ext/language-transformer.d.ts b/types/ext/language-transformer.d.ts
index 02457523..cf5a0041 100644
--- a/types/ext/language-transformer.d.ts
+++ b/types/ext/language-transformer.d.ts
@@ -18,7 +18,9 @@
export type LanguageTransformDescriptor = {
language: string;
conditions: ConditionMapObject;
- transforms: Transform[];
+ transforms: {
+ [name: string]: Transform;
+ };
};
export type ConditionMapObject = {
diff --git a/types/ext/translation-internal.d.ts b/types/ext/translation-internal.d.ts
index 3360ac06..0efbe54f 100644
--- a/types/ext/translation-internal.d.ts
+++ b/types/ext/translation-internal.d.ts
@@ -40,15 +40,29 @@ export type TextDeinflectionOptionsArrays = [
emphatic: [collapseEmphatic: boolean, collapseEmphaticFull: boolean][],
];
+export type TermDictionaryEntry = Omit<Dictionary.TermDictionaryEntry, 'inflectionRuleChainCandidates'> & {
+ inflectionRuleChainCandidates: InflectionRuleChainCandidate[];
+};
+
+export type InflectionRuleChainCandidate = {
+ source: Dictionary.InflectionSource;
+ inflectionRules: string[];
+};
+
export type DatabaseDeinflection = {
originalText: string;
transformedText: string;
deinflectedText: string;
conditions: number;
- inflectionRuleChainCandidates: Dictionary.InflectionRuleChainCandidate[];
+ inflectionRuleChainCandidates: InflectionRuleChainCandidate[];
databaseEntries: DictionaryDatabase.TermEntry[];
};
+export type DictionaryEntryGroup = {
+ ids: Set<number>;
+ dictionaryEntries: TermDictionaryEntry[];
+};
+
export type TextProcessorMap = Map<
string,
{
diff --git a/types/ext/translator.d.ts b/types/ext/translator.d.ts
index fb8d1142..0a4053cf 100644
--- a/types/ext/translator.d.ts
+++ b/types/ext/translator.d.ts
@@ -63,11 +63,6 @@ export type TagTargetItem = {
targets: Dictionary.Tag[][];
};
-export type DictionaryEntryGroup = {
- ids: Set<number>;
- dictionaryEntries: Dictionary.TermDictionaryEntry[];
-};
-
export type SequenceQuery = {
query: number;
dictionary: string;