java.lang.Object
com.iqser.red.service.redaction.v1.server.model.dictionary.Dictionary

public class Dictionary extends Object
A class representing a dictionary used for redaction processes, containing various dictionary models and their versions.
  • Constructor Details

    • Dictionary

      public Dictionary(List<DictionaryModel> dictionaryModels, com.iqser.red.service.redaction.v1.server.model.dictionary.DictionaryVersion version)
  • Method Details

    • getDictionaryRank

      public int getDictionaryRank(String type)
    • hasLocalEntries

      public boolean hasLocalEntries()
      Checks if the dictionary contains local entries.
      Returns:
      true if any dictionary model contains local entries, false otherwise.
    • getTypes

      public Set<String> getTypes()
    • getType

      public DictionaryModel getType(String type)
      Retrieves the DictionaryModel 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

      public boolean isHint(String type)
      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

      public boolean isCaseInsensitiveDictionary(String type)
      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 - The TextEntity 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 - The TextEntity 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 - The TextEntity 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 a TextEntity into individual author names based on commas or new lines.
      Parameters:
      textEntity - The TextEntity to split.
      Returns:
      A list of strings where each string is an author name.
    • getLocalAccessMap

      public Map<String,DictionaryModel> getLocalAccessMap()
    • setDictionaryModels

      public void setDictionaryModels(List<DictionaryModel> dictionaryModels)
    • setLocalAccessMap

      public void setLocalAccessMap(Map<String,DictionaryModel> localAccessMap)
    • setVersion

      public void setVersion(com.iqser.red.service.redaction.v1.server.model.dictionary.DictionaryVersion version)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getDictionaryModels

      public List<DictionaryModel> getDictionaryModels()
    • getVersion

      public com.iqser.red.service.redaction.v1.server.model.dictionary.DictionaryVersion getVersion()