Class HeadRules
java.lang.Object
opennlp.tools.parser.lang.en.HeadRules
- All Implemented Interfaces:
opennlp.tools.parser.GapLabeler, opennlp.tools.parser.HeadRules, opennlp.tools.util.model.SerializableArtifact
public class HeadRules
extends Object
implements opennlp.tools.parser.HeadRules, opennlp.tools.parser.GapLabeler, opennlp.tools.util.model.SerializableArtifact
Class for storing the English
HeadRules associated with parsing.-
Constructor Details
-
HeadRules
Creates a new set of head rules based on the specified reader.- Parameters:
rulesReader- AReaderfor a head rules file.- Throws:
IOException- Thrown f the head rules reader can not be read.
-
-
Method Details
-
getPunctuationTags
-
getHead
- Specified by:
getHeadin interfaceopennlp.tools.parser.HeadRules
-
labelGaps
- Specified by:
labelGapsin interfaceopennlp.tools.parser.GapLabeler
-
serialize
Serializes the head rules via aWriterin a format suitable for loading the head rules again. The encoding must be taken into account while working with the writer and reader.Once the entries have been written, the
writeris flushed.Note: The
writerremains open after this method returns.- Parameters:
writer- TheWriterto write the head rules to.- Throws:
IOException- Thrown if IO errors occurred during write operation.
-
hashCode
-
equals
-
getArtifactSerializerClass
- Specified by:
getArtifactSerializerClassin interfaceopennlp.tools.util.model.SerializableArtifact
-