public class AncoraHeadRules extends Object implements HeadRules, GapLabeler, opennlp.tools.util.model.SerializableArtifact
| Modifier and Type | Class and Description |
|---|---|
static class |
AncoraHeadRules.AncoraHeadRulesSerializer |
| Constructor and Description |
|---|
AncoraHeadRules(Reader rulesReader)
Creates a new set of head rules based on the specified reader.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object obj) |
Class<?> |
getArtifactSerializerClass() |
Parse |
getHead(Parse[] constituents,
String type)
Returns the head constituent for the specified constituents of the
specified type.
|
Set<String> |
getPunctuationTags()
Returns the set of punctuation tags.
|
int |
hashCode() |
void |
labelGaps(Stack<Constituent> stack)
Labels the constituents found in the stack with gap labels if appropriate.
|
void |
serialize(Writer writer)
Writes the head rules to the writer in a format suitable for loading the
head rules again with the constructor.
|
public AncoraHeadRules(Reader rulesReader) throws IOException
rulesReader - the head rules reader.IOException - if the head rules reader can not be read.public Set<String> getPunctuationTags()
HeadRulesgetPunctuationTags in interface HeadRulespublic Parse getHead(Parse[] constituents, String type)
HeadRulespublic void labelGaps(Stack<Constituent> stack)
GapLabelerlabelGaps in interface GapLabelerstack - The stack of un-completed constituents.public void serialize(Writer writer) throws IOException
After the entries have been written, the writer is flushed. The writer remains open after this method returns.
writer - the writerIOException - if io exceptionpublic Class<?> getArtifactSerializerClass()
getArtifactSerializerClass in interface opennlp.tools.util.model.SerializableArtifactCopyright © 2017 IXA pipes. All rights reserved.