diff --git a/apps/red-ui/src/app/services/entity-services/dictionary.service.ts b/apps/red-ui/src/app/services/entity-services/dictionary.service.ts index bc2bc8438..2cb0fac0a 100644 --- a/apps/red-ui/src/app/services/entity-services/dictionary.service.ts +++ b/apps/red-ui/src/app/services/entity-services/dictionary.service.ts @@ -12,7 +12,6 @@ import { DossierDictionariesMapService } from '@services/entity-services/dossier import { List } from '@iqser/common-ui/lib/utils'; import { IMAGE_CATEGORIES } from '../../modules/file-preview/utils/constants'; -const MIN_WORD_LENGTH = 2; const IMAGE_TYPES = ['image', 'formula', 'ocr']; @Injectable({ @@ -100,20 +99,13 @@ export class DictionaryService extends EntitiesService ) { const entriesToAdd: Array = []; const initialEntriesSet = new Set(initialEntries); - let hasInvalidRows = false; for (let i = 0; i < entries.length; i++) { const entry = entries.at(i); if (!entry.trim() || initialEntriesSet.has(entry)) { continue; } - hasInvalidRows ||= entry.length < MIN_WORD_LENGTH; entriesToAdd.push(entry); } - if (hasInvalidRows) { - this._toaster.error(_('dictionary-overview.error.entries-too-short')); - - throw new Error('Entries too short'); - } const deletedEntries: Array = []; const entriesSet = new Set(entries); for (let i = 0; i < initialEntries.length; i++) { @@ -260,7 +252,15 @@ export class DictionaryService extends EntitiesService } } if (!manualTypeExists) { - dictionaries.push(new Dictionary({ hexColor: FALLBACK_COLOR, type: SuperTypes.ManualRedaction }, true)); + dictionaries.push( + new Dictionary( + { + hexColor: FALLBACK_COLOR, + type: SuperTypes.ManualRedaction, + }, + true, + ), + ); } return dictionaries; diff --git a/apps/red-ui/src/assets/i18n/redact/de.json b/apps/red-ui/src/assets/i18n/redact/de.json index 2a8b0dcb8..1133730cd 100644 --- a/apps/red-ui/src/assets/i18n/redact/de.json +++ b/apps/red-ui/src/assets/i18n/redact/de.json @@ -700,7 +700,6 @@ "download": "Download current entries", "error": { "400": "Cannot update dictionary because at least one of the newly added words where recognized as a general term that appear too often in texts.", - "entries-too-short": "Einige Einträge im Wörterbuch unterschreiten die Mindestlänge von 2 Zeichen. Diese sind rot markiert.", "generic": "Es ist ein Fehler aufgetreten ... Das Wörterbuch konnte nicht aktualisiert werden!" }, "revert-changes": "Rückgängig machen", diff --git a/apps/red-ui/src/assets/i18n/redact/en.json b/apps/red-ui/src/assets/i18n/redact/en.json index 146e97865..3f29a5914 100644 --- a/apps/red-ui/src/assets/i18n/redact/en.json +++ b/apps/red-ui/src/assets/i18n/redact/en.json @@ -700,7 +700,6 @@ "download": "Download current entries", "error": { "400": "Cannot update dictionary because at least one of the newly added words where recognized as a general term that appear too often in texts.", - "entries-too-short": "Some entries of the dictionary are below the minimum length of 2. These are highlighted with red!", "generic": "Something went wrong... Dictionary update failed!" }, "revert-changes": "Revert", diff --git a/apps/red-ui/src/assets/i18n/scm/de.json b/apps/red-ui/src/assets/i18n/scm/de.json index 0b4c9ecfc..da5d86101 100644 --- a/apps/red-ui/src/assets/i18n/scm/de.json +++ b/apps/red-ui/src/assets/i18n/scm/de.json @@ -700,7 +700,6 @@ "download": "", "error": { "400": "", - "entries-too-short": "Einige Einträge im Wörterbuch unterschreiten die Mindestlänge von 2 Zeichen. Diese sind rot markiert.", "generic": "Es ist ein Fehler aufgetreten ... Das Wörterbuch konnte nicht aktualisiert werden!" }, "revert-changes": "Rückgängig machen", diff --git a/apps/red-ui/src/assets/i18n/scm/en.json b/apps/red-ui/src/assets/i18n/scm/en.json index 05ed3505d..8b4846415 100644 --- a/apps/red-ui/src/assets/i18n/scm/en.json +++ b/apps/red-ui/src/assets/i18n/scm/en.json @@ -700,7 +700,6 @@ "download": "Download current entries", "error": { "400": "Cannot update dictionary because at least one of the newly added words where recognized as a general term that appear too often in texts.", - "entries-too-short": "Some entries of the dictionary are below the minimum length of 2. These are highlighted with red!", "generic": "Something went wrong... Dictionary update failed!" }, "revert-changes": "Revert",