Package opennlp.tools.parser.lang.en
Class HeadRules
java.lang.Object
opennlp.tools.parser.lang.en.HeadRules
- All Implemented Interfaces:
- GapLabeler,- HeadRules,- SerializableArtifact
Class for storing the English 
HeadRules associated with parsing.- 
Nested Class SummaryNested Classes
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleanClass<?>Retrieves the class which can serialize and recreate this artifact.Retrieves the headconstituentfor the specified constituents of giventype.inthashCode()voidlabelGaps(Stack<Constituent> stack) Labelsconstituentsfound in thestackwith gap labels if appropriate.voidSerializes the head rules via aWriterin a format suitable for loading the head rules again.
- 
Constructor Details- 
HeadRulesCreates a new set of head rules based on the specified reader.- Parameters:
- rulesReader- A- Readerfor a head rules file.
- Throws:
- IOException- Thrown f the head rules reader can not be read.
 
 
- 
- 
Method Details- 
getPunctuationTags- Specified by:
- getPunctuationTagsin interface- HeadRules
- Returns:
- Retrieves the set of punctuation tags. Attachment decisions for these tags will not be modeled.
 
- 
getHeadDescription copied from interface:HeadRulesRetrieves the headconstituentfor the specified constituents of giventype.- Specified by:
- getHeadin interface- HeadRules
- Parameters:
- constituents- The- constituentswhich make up a constituent of the specified- type.
- type- The type of a constituent which is made up of the- constituents.
- Returns:
- The constituentwhich represents the head.
 
- 
labelGapsDescription copied from interface:GapLabelerLabelsconstituentsfound in thestackwith gap labels if appropriate.- Specified by:
- labelGapsin interface- GapLabeler
- Parameters:
- stack- The- Stackof un-completed- constituents.
 
- 
serializeSerializes 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- The- Writerto write the head rules to.
- Throws:
- IOException- Thrown if IO errors occurred during write operation.
 
- 
hashCodepublic int hashCode()
- 
equals
- 
getArtifactSerializerClassDescription copied from interface:SerializableArtifactRetrieves the class which can serialize and recreate this artifact.Note: The serializer class must have a public zero argument constructoror an exception is thrown during model serialization/loading.- Specified by:
- getArtifactSerializerClassin interface- SerializableArtifact
- Returns:
- The corresponding ArtifactSerializerclass.
 
 
-