aboutsummaryrefslogtreecommitdiff
path: root/types
diff options
context:
space:
mode:
authorStefanVukovic99 <stefanvukovic44@gmail.com>2024-06-03 19:25:51 +0200
committerGitHub <noreply@github.com>2024-06-03 17:25:51 +0000
commit7955fc85ac089d856b44bdea78eccd26ffbd690c (patch)
tree6a7cfc6464612f9f129b25fa59a46f9c7c0e72b5 /types
parentd2fce502ecb00e3c9202295c93fbb8c554ddbd69 (diff)
display inflection rule descriptions (#1000)24.6.3.0
* load descriptions in deinflector * description functions in deinflectors * show descriptions in title * use toaster * use names without internal * css lint * reformat transform descriptors * fix merge errors * done? * rename method
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;