edu.stanford.nlp.parser.dvparser
Class FilterConfusingRules

java.lang.Object
  extended by edu.stanford.nlp.parser.dvparser.FilterConfusingRules
All Implemented Interfaces:
Filter<Tree>, java.io.Serializable

public class FilterConfusingRules
extends java.lang.Object
implements Filter<Tree>

This filter rejects Trees which have unary or binary productions which the given parser does not contain.
One situation where this happens often is when grammar compaction is turned on; this can often result in a Tree where there is no BinaryRule which could explicitely create a particular node, but the Tree is still valid. However, for various applications of the DVParser, this kind of Tree is useless. A good way to eliminate most of this kind of tree is to make sure the parser is trained with -compactGrammar 0.

See Also:
Serialized Form

Constructor Summary
FilterConfusingRules(LexicalizedParser parser)
           
 
Method Summary
 boolean accept(Tree tree)
          Checks if the given object passes the filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterConfusingRules

public FilterConfusingRules(LexicalizedParser parser)
Method Detail

accept

public boolean accept(Tree tree)
Description copied from interface: Filter
Checks if the given object passes the filter.

Specified by:
accept in interface Filter<Tree>
Parameters:
tree - an object to test
Returns:
Whether the object should be accepted (for some processing)


Stanford NLP Group