kwic
Class DefaultWordFilter
java.lang.Object
|
+--kwic.DefaultWordFilter
- All Implemented Interfaces:
- WordCanonical
- public class DefaultWordFilter
- extends Object
- implements WordCanonical
A default implementation of the WordCanonical interface.
Why isn't this a private class of Word?
Why isn't this an inner class of Word?
|
Method Summary |
static kwic.WordCanonical |
instance()
Singleton pattern: return one instance, always the same, of this
class. |
String |
makeCanonical(String temp)
Filter the supplied String (which is the String of
a Word presumably) into a canonical form
for subsequent matching. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DefaultWordFilter
public DefaultWordFilter()
makeCanonical
public String makeCanonical(String temp)
- Filter the supplied
String (which is the String of
a Word presumably) into a canonical form
for subsequent matching.
For this default filter, do the following:
- Remove punctuation and spaces.
- Convert to lower case.
- Specified by:
makeCanonical in interface WordCanonical
instance
public static kwic.WordCanonical instance()
- Singleton pattern: return one instance, always the same, of this
class.