no.priv.garshol.duke.cleaners
Class AbstractRuleBasedCleaner

java.lang.Object
  extended by no.priv.garshol.duke.cleaners.AbstractRuleBasedCleaner
All Implemented Interfaces:
Cleaner
Direct Known Subclasses:
NorwegianAddressCleaner, NorwegianCompanyNameCleaner

public abstract class AbstractRuleBasedCleaner
extends Object
implements Cleaner

Helper class for building regular-expression based cleaners.


Constructor Summary
AbstractRuleBasedCleaner()
          Initializes an empty cleaner.
 
Method Summary
 void add(String regex, String replacement)
          Adds a rule replacing all substrings matching the regular expression with the replacement string.
 void add(String regex, String replacement, int groupno)
          Adds a rule replacing all substrings matching the specified group within the regular expression with the replacement string.
 String clean(String value)
          Returns a cleaned value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractRuleBasedCleaner

public AbstractRuleBasedCleaner()
Initializes an empty cleaner.

Method Detail

clean

public String clean(String value)
Description copied from interface: Cleaner
Returns a cleaned value.

Specified by:
clean in interface Cleaner

add

public void add(String regex,
                String replacement)
Adds a rule replacing all substrings matching the regular expression with the replacement string.


add

public void add(String regex,
                String replacement,
                int groupno)
Adds a rule replacing all substrings matching the specified group within the regular expression with the replacement string.



Copyright © 2013. All Rights Reserved.