cz.cuni.mff.ksi.jinfer.twostep.cleaning.emptychildren
Class EmptyChildren<T>
java.lang.Object
cz.cuni.mff.ksi.jinfer.twostep.cleaning.emptychildren.EmptyChildren<T>
- All Implemented Interfaces:
- RegularExpressionCleaner<T>
public class EmptyChildren<T>
- extends Object
- implements RegularExpressionCleaner<T>
Cleans empty children and children with one child.
For example regular expression: ((), a, (b)), gets cleaned to (a, b).
First empty concatenation () is removed, and concatenation (b)
with only one child is replaced by token b.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EmptyChildren
public EmptyChildren()
cleanRegularExpression
public Regexp<T> cleanRegularExpression(Regexp<T> regexp)
- Description copied from interface:
RegularExpressionCleaner
- Clean given regular expression.
Returns new regexp which should be nicer in some way (no empty constructs, or
no shorter form). But which has to express same language.
- Specified by:
cleanRegularExpression
in interface RegularExpressionCleaner<T>
- Parameters:
regexp
- regexp to clean
- Returns:
- cleaned regexp.
Generated on Fri Dec 9 00:01:25 CET 2011