org.dspace.text.filter
Class InitialArticleWord

java.lang.Object
  extended by 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 Summary
protected InitialArticleWord()
           
protected InitialArticleWord(boolean stripWord)
           
 
Method Summary
 String filter(String str)
          When no language is passed, use null and let implementation decide what to do
 String filter(String str, String lang)
          Do an initial definite/indefinite article filter on the passed string.
protected abstract  String[] getArticleWords(String lang)
          Abstract method to get the list of words to use in the initial word filter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitialArticleWord

protected InitialArticleWord(boolean stripWord)

InitialArticleWord

protected InitialArticleWord()
Method Detail

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


Copyright © 2010 DuraSpace. All Rights Reserved.