Class InitialArticleWord

java.lang.Object
org.dspace.text.filter.InitialArticleWord
All Implemented Interfaces:
TextFilter
Direct Known Subclasses:
MARC21InitialArticleWord, StandardInitialArticleWord

public abstract class InitialArticleWord extends Object implements TextFilter
Abstract class for implementing initial article word filters Allows you to create new classes with their own rules for mapping languages to article word lists.
Author:
Graham Triggs
  • Constructor Details

    • InitialArticleWord

      protected InitialArticleWord(boolean stripWord)
    • InitialArticleWord

      protected InitialArticleWord()
  • Method Details

    • filter

      public String filter(String str)
      When no language is passed, use null and let implementation decide what to do
      Specified by:
      filter in interface TextFilter
    • filter

      public String filter(String str, String lang)
      Do an initial definite/indefinite article filter on the passed string. On matching an initial word, can strip or move to the end, depending on the configuration of the implementing class.
      Specified by:
      filter in interface TextFilter
      Parameters:
      str - The string to parse
      lang - The language of the passed string
      Returns:
      String The filtered string
    • getArticleWords

      protected abstract String[] getArticleWords(String lang)
      Abstract method to get the list of words to use in the initial word filter
      Parameters:
      lang - The language to retrieve article words for
      Returns:
      An array of definite/indefinite article words