Class NamedEntityEnricher

java.lang.Object
io.goobi.viewer.controller.model.alto.NamedEntityEnricher
All Implemented Interfaces:
TextEnricher

public class NamedEntityEnricher extends Object implements TextEnricher
TextEnricher implementation that wraps ALTO word tokens referenced by named-entity tags in interactive HTML buttons. Each button carries data attributes for the entity type, authority URI, and a pre-built search URL for further lookup.
  • Constructor Details

    • NamedEntityEnricher

      public NamedEntityEnricher()
  • Method Details

    • enrich

      public String enrich(String content, de.intranda.digiverso.ocr.alto.model.structureclasses.lineelements.LineElement element)
      Wraps every word that references a named-entity tag in an interactive HTML button. Previously bounded to one enrichment per page-render by a dead MAX_ENRICHMENTS limit (silently produced only a single button regardless of how many entities the page contained); the limit has been removed so all referencing words are enriched.
      Specified by:
      enrich in interface TextEnricher
      Parameters:
      content - the textual content of the word being enriched
      element - the ALTO line element whose word content is being processed
      Returns:
      the enriched HTML button markup if the element is referenced by at least one named-entity tag, otherwise the unchanged content string