net.java.sen.filter.stream
Class CommentFilter

java.lang.Object
  extended by net.java.sen.filter.stream.CommentFilter
All Implemented Interfaces:
StreamFilter

public class CommentFilter
extends Object
implements StreamFilter

A filter to ignore delimited comments in the input sentence


Field Summary
protected  List<net.java.sen.filter.stream.CommentFilter.Rule> ruleList
          The list of rules defining the start and end of comments, and the part-of-speech code to be used in the Tokens used to replace them
 
Constructor Summary
CommentFilter()
           
 
Method Summary
 List<Token> postProcess(List<Token> tokens)
          Post-processes analysed tokens
 void preProcess(Sentence sentence)
          Pre-processes a sentence
 void readRules(BufferedReader reader)
          Reads the rules to apply as space-delimited text
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ruleList

protected List<net.java.sen.filter.stream.CommentFilter.Rule> ruleList
The list of rules defining the start and end of comments, and the part-of-speech code to be used in the Tokens used to replace them

Constructor Detail

CommentFilter

public CommentFilter()
Method Detail

readRules

public void readRules(BufferedReader reader)
               throws IOException
Reads the rules to apply as space-delimited text

Parameters:
reader - The reader from which to read the rules
Throws:
IOException

preProcess

public void preProcess(Sentence sentence)
Description copied from interface: StreamFilter
Pre-processes a sentence

Specified by:
preProcess in interface StreamFilter
Parameters:
sentence - The sentence be pre-processed

postProcess

public List<Token> postProcess(List<Token> tokens)
Description copied from interface: StreamFilter
Post-processes analysed tokens

Specified by:
postProcess in interface StreamFilter
Parameters:
tokens - The analysed tokens
Returns:
The post-processed tokens


Copyright © 2012. All Rights Reserved.