Class Dictionary
java.lang.Object
com.iqser.red.service.redaction.v1.server.model.dictionary.Dictionary
A class representing a dictionary used for redaction processes, containing various dictionary models and their versions.
-
Constructor Summary
ConstructorsConstructorDescriptionDictionary
(List<DictionaryModel> dictionaryModels, com.iqser.red.service.redaction.v1.server.model.dictionary.DictionaryVersion version) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addMultipleAuthorsAsRecommendation
(com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity textEntity) Adds multiple author names contained within a text entity as recommendations in the dictionary.boolean
int
getDictionaryRank
(String type) Retrieves theDictionaryModel
of a specified type.getTypes()
com.iqser.red.service.redaction.v1.server.model.dictionary.DictionaryVersion
int
hashCode()
boolean
Checks if the dictionary contains local entries.boolean
Checks if the dictionary of a specific type is case-insensitive.boolean
Checks if the dictionary of a specific type is considered a hint.void
recommendEverywhere
(com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity textEntity) Recommends a text entity for inclusion in every dictionary model without separating the last name.void
recommendEverywhereWithLastNameSeparately
(com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity textEntity) Recommends a text entity for inclusion in every dictionary model with the last name added separately.void
setDictionaryModels
(List<DictionaryModel> dictionaryModels) void
setLocalAccessMap
(Map<String, DictionaryModel> localAccessMap) void
setVersion
(com.iqser.red.service.redaction.v1.server.model.dictionary.DictionaryVersion version) splitIntoAuthorNames
(com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity textEntity) Splits aTextEntity
into individual author names based on commas or new lines.toString()
-
Constructor Details
-
Dictionary
public Dictionary(List<DictionaryModel> dictionaryModels, com.iqser.red.service.redaction.v1.server.model.dictionary.DictionaryVersion version)
-
-
Method Details
-
getDictionaryRank
-
hasLocalEntries
public boolean hasLocalEntries()Checks if the dictionary contains local entries.- Returns:
- true if any dictionary model contains local entries, false otherwise.
-
getTypes
-
getType
Retrieves theDictionaryModel
of a specified type.- Parameters:
type
- The type of dictionary model to retrieve.- Returns:
- The
DictionaryModel
of the specified type. - Throws:
com.iqser.red.service.redaction.v1.server.utils.exception.NotFoundException
- If the specified type is not found in the dictionary.
-
isHint
Checks if the dictionary of a specific type is considered a hint.- Parameters:
type
- The type of dictionary to check.- Returns:
- true if the dictionary model is marked as a hint, false otherwise.
-
isCaseInsensitiveDictionary
Checks if the dictionary of a specific type is case-insensitive.- Parameters:
type
- The type of dictionary to check.- Returns:
- true if the dictionary is case-insensitive, false otherwise.
-
recommendEverywhere
public void recommendEverywhere(com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity textEntity) Recommends a text entity for inclusion in every dictionary model without separating the last name.- Parameters:
textEntity
- TheTextEntity
to be recommended.
-
recommendEverywhereWithLastNameSeparately
public void recommendEverywhereWithLastNameSeparately(com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity textEntity) Recommends a text entity for inclusion in every dictionary model with the last name added separately.- Parameters:
textEntity
- TheTextEntity
to be recommended.
-
addMultipleAuthorsAsRecommendation
public void addMultipleAuthorsAsRecommendation(com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity textEntity) Adds multiple author names contained within a text entity as recommendations in the dictionary.- Parameters:
textEntity
- TheTextEntity
containing author names to be added.
-
splitIntoAuthorNames
public static List<String> splitIntoAuthorNames(com.iqser.red.service.redaction.v1.server.model.document.entity.TextEntity textEntity) Splits aTextEntity
into individual author names based on commas or new lines.- Parameters:
textEntity
- TheTextEntity
to split.- Returns:
- A list of strings where each string is an author name.
-
getLocalAccessMap
-
setDictionaryModels
-
setLocalAccessMap
-
setVersion
public void setVersion(com.iqser.red.service.redaction.v1.server.model.dictionary.DictionaryVersion version) -
equals
-
hashCode
public int hashCode() -
toString
-
getDictionaryModels
-
getVersion
public com.iqser.red.service.redaction.v1.server.model.dictionary.DictionaryVersion getVersion()
-