com.aliasi.tokenizer
Class LowerCaseTokenizerFactory

java.lang.Object
  extended by com.aliasi.tokenizer.ModifiedTokenizerFactory
      extended by com.aliasi.tokenizer.ModifyTokenTokenizerFactory
          extended by com.aliasi.tokenizer.LowerCaseTokenizerFactory
All Implemented Interfaces:
TokenizerFactory, Serializable

public class LowerCaseTokenizerFactory
extends ModifyTokenTokenizerFactory
implements Serializable

A LowerCaseTokenizerFactory filters the tokenizers produced by a base tokenizer factory to produce lower case output. A locale must be specified in order to carry out the case conversion.

Thread Safety

A lowercasing tokenizer factory is thread safe if its base tokenizer factory is thread safe.

Serialization

A lowercasing tokenizer factory is serializable if its base tokenizer factory is serializable.

Since:
Lingpipe3.8
Version:
3.8
Author:
Bob Carpenter
See Also:
Serialized Form

Constructor Summary
LowerCaseTokenizerFactory(TokenizerFactory factory)
          Construct a lowercasing tokenizer factory from the specified base factory using the locale Locale.English
LowerCaseTokenizerFactory(TokenizerFactory factory, Locale locale)
          Construct a lowercasing tokenizer factory from the specified base factory using the specified locale.
 
Method Summary
 Locale locale()
          Return the locale for this factory.
 String modifyToken(String token)
          Return the lowercased version of the specified token using this factory's locale.
 
Methods inherited from class com.aliasi.tokenizer.ModifyTokenTokenizerFactory
modify, modifyWhitespace
 
Methods inherited from class com.aliasi.tokenizer.ModifiedTokenizerFactory
baseTokenizerFactory, tokenizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LowerCaseTokenizerFactory

public LowerCaseTokenizerFactory(TokenizerFactory factory)
Construct a lowercasing tokenizer factory from the specified base factory using the locale Locale.English

Parameters:
factory - Base tokenizer factory.

LowerCaseTokenizerFactory

public LowerCaseTokenizerFactory(TokenizerFactory factory,
                                 Locale locale)
Construct a lowercasing tokenizer factory from the specified base factory using the specified locale.

Parameters:
factory - Base tokenizer factory.
locale - Locale to use for lowercasing.
Method Detail

locale

public Locale locale()
Return the locale for this factory.

Returns:
The locale for this factory.

modifyToken

public String modifyToken(String token)
Return the lowercased version of the specified token using this factory's locale.

Overrides:
modifyToken in class ModifyTokenTokenizerFactory
Parameters:
token - Token to modify.
Returns:
Lowercased token.