public class NGram extends SemanticProcessor implements com.exalead.util.Checkable, java.io.Serializable
SemanticProcessor.Transformer<T>, SemanticProcessor.Visitor
Modifier and Type | Field and Description |
---|---|
boolean |
addCanonicalForm
Deprecated.
|
static boolean |
DEFAULT_ADD_CANONICAL_FORM |
static boolean |
DEFAULT_DIFFERENTIATE_N_GRAMS |
static java.lang.String |
DEFAULT_FROM_TAGS |
static java.lang.String |
DEFAULT_IF_TAGS |
static boolean |
DEFAULT_KEEP_LONGEST_MATCH |
static boolean |
DEFAULT_MULTIVALUED |
static java.lang.String |
DEFAULT_SKIP_TAGS |
static java.lang.String |
DEFAULT_UNLESS_TAGS |
boolean |
differentiateNGrams |
java.lang.String |
fromTags |
java.lang.String |
ifTags |
boolean |
keepLongestMatch |
int |
maxLength |
int |
minLength |
boolean |
multivalued
Deprecated.
|
java.lang.String |
skipTags |
java.lang.String |
unlessTags |
contexts, name, src
Constructor and Description |
---|
NGram() |
NGram(NGram o)
Copy constructor
|
Modifier and Type | Method and Description |
---|---|
<T> T |
accept(SemanticProcessor.Transformer<T> transformer,
T[] t) |
void |
accept(SemanticProcessor.Visitor visitor) |
void |
check(boolean deep,
java.lang.String errorContext)
Checks this NGram.
|
static NGram |
fromString(java.lang.String s)
String representation of this NGram.
|
java.lang.String |
getFromTags()
The optional list of annotations (comma separated) sorted by priority that will be used to build the ngram.
|
java.lang.String |
getIfTags()
The optional list of annotation tags (comma separated) required to consider the current token.
|
int |
getMaxLength()
The maximum number of words.
|
int |
getMinLength()
The minimum number of words.
|
java.lang.String |
getSkipTags()
The optional list of annotation tags (comma separated) to skip/ignore.
|
java.lang.String |
getUnlessTags()
The optional list of annotation tags (comma separated) not-required to consider the current token.
|
boolean |
isAddCanonicalForm()
Deprecated.
|
boolean |
isDifferentiateNGrams()
Should the annotation be '2gram' instead of the constant 'ngram' in case of a bigram
|
boolean |
isKeepLongestMatch()
Only the longest match should be kept.
|
boolean |
isMultivalued()
Deprecated.
|
NGram |
makeCopy()
Creates and returns a deep copy of this NGram.
|
static NGram |
readFrom(java.io.InputStream is)
Read this NGram from an XML fragment.
|
void |
setAddCanonicalForm(boolean addCanonicalForm)
Deprecated.
|
void |
setDifferentiateNGrams(boolean differentiateNGrams)
Should the annotation be '2gram' instead of the constant 'ngram' in case of a bigram
|
void |
setFromTags(java.lang.String fromTags)
The optional list of annotations (comma separated) sorted by priority that will be used to build the ngram.
|
void |
setIfTags(java.lang.String ifTags)
The optional list of annotation tags (comma separated) required to consider the current token.
|
void |
setKeepLongestMatch(boolean keepLongestMatch)
Only the longest match should be kept.
|
void |
setMaxLength(int maxLength)
The maximum number of words.
|
void |
setMinLength(int minLength)
The minimum number of words.
|
void |
setMultivalued(boolean multivalued)
Deprecated.
|
void |
setSkipTags(java.lang.String skipTags)
The optional list of annotation tags (comma separated) to skip/ignore.
|
void |
setUnlessTags(java.lang.String unlessTags)
The optional list of annotation tags (comma separated) not-required to consider the current token.
|
java.lang.String |
toString()
String representation of this NGram.
|
NGram |
withAddCanonicalForm(boolean addCanonicalForm)
Deprecated.
|
NGram |
withAddCanonicalForm(java.lang.Boolean addCanonicalForm)
Deprecated.
|
NGram |
withContexts(java.lang.String contexts) |
NGram |
withDifferentiateNGrams(boolean differentiateNGrams) |
NGram |
withDifferentiateNGrams(java.lang.Boolean differentiateNGrams) |
NGram |
withFromTags(java.lang.String fromTags) |
NGram |
withIfTags(java.lang.String ifTags) |
NGram |
withKeepLongestMatch(boolean keepLongestMatch) |
NGram |
withKeepLongestMatch(java.lang.Boolean keepLongestMatch) |
NGram |
withMaxLength(int maxLength) |
NGram |
withMaxLength(java.lang.Integer maxLength) |
NGram |
withMinLength(int minLength) |
NGram |
withMinLength(java.lang.Integer minLength) |
NGram |
withMultivalued(boolean multivalued)
Deprecated.
|
NGram |
withMultivalued(java.lang.Boolean multivalued)
Deprecated.
|
NGram |
withName(java.lang.String name) |
NGram |
withSkipTags(java.lang.String skipTags) |
NGram |
withSrc(java.lang.String src)
Deprecated.
|
NGram |
withUnlessTags(java.lang.String unlessTags) |
void |
writeTo(java.io.OutputStream os)
Write this NGram as an XML fragment
|
getContexts, getName, getSrc, setContexts, setName, setSrc
public java.lang.String fromTags
public static final java.lang.String DEFAULT_FROM_TAGS
public java.lang.String ifTags
public static final java.lang.String DEFAULT_IF_TAGS
public java.lang.String unlessTags
public static final java.lang.String DEFAULT_UNLESS_TAGS
public java.lang.String skipTags
public static final java.lang.String DEFAULT_SKIP_TAGS
public int minLength
public int maxLength
@Deprecated public boolean addCanonicalForm
public static final boolean DEFAULT_ADD_CANONICAL_FORM
@Deprecated public boolean multivalued
public static final boolean DEFAULT_MULTIVALUED
public boolean keepLongestMatch
public static final boolean DEFAULT_KEEP_LONGEST_MATCH
public boolean differentiateNGrams
public static final boolean DEFAULT_DIFFERENTIATE_N_GRAMS
public NGram()
public NGram(NGram o)
public NGram withName(java.lang.String name)
withName
in class SemanticProcessor
public NGram withContexts(java.lang.String contexts)
withContexts
in class SemanticProcessor
@Deprecated public NGram withSrc(java.lang.String src)
withSrc
in class SemanticProcessor
public void setFromTags(java.lang.String fromTags)
public java.lang.String getFromTags()
public NGram withFromTags(java.lang.String fromTags)
public void setIfTags(java.lang.String ifTags)
public java.lang.String getIfTags()
public NGram withIfTags(java.lang.String ifTags)
public void setUnlessTags(java.lang.String unlessTags)
public java.lang.String getUnlessTags()
public NGram withUnlessTags(java.lang.String unlessTags)
public void setSkipTags(java.lang.String skipTags)
public java.lang.String getSkipTags()
public NGram withSkipTags(java.lang.String skipTags)
public void setMinLength(int minLength)
public int getMinLength()
public NGram withMinLength(int minLength)
public NGram withMinLength(java.lang.Integer minLength)
public void setMaxLength(int maxLength)
public int getMaxLength()
public NGram withMaxLength(int maxLength)
public NGram withMaxLength(java.lang.Integer maxLength)
@Deprecated public void setAddCanonicalForm(boolean addCanonicalForm)
@Deprecated public boolean isAddCanonicalForm()
@Deprecated public NGram withAddCanonicalForm(boolean addCanonicalForm)
@Deprecated public NGram withAddCanonicalForm(java.lang.Boolean addCanonicalForm)
@Deprecated public void setMultivalued(boolean multivalued)
@Deprecated public boolean isMultivalued()
@Deprecated public NGram withMultivalued(boolean multivalued)
@Deprecated public NGram withMultivalued(java.lang.Boolean multivalued)
public void setKeepLongestMatch(boolean keepLongestMatch)
public boolean isKeepLongestMatch()
public NGram withKeepLongestMatch(boolean keepLongestMatch)
public NGram withKeepLongestMatch(java.lang.Boolean keepLongestMatch)
public void setDifferentiateNGrams(boolean differentiateNGrams)
public boolean isDifferentiateNGrams()
public NGram withDifferentiateNGrams(boolean differentiateNGrams)
public NGram withDifferentiateNGrams(java.lang.Boolean differentiateNGrams)
public NGram makeCopy()
makeCopy
in class SemanticProcessor
public static NGram readFrom(java.io.InputStream is) throws javax.xml.bind.JAXBException
javax.xml.bind.JAXBException
public void writeTo(java.io.OutputStream os) throws javax.xml.bind.JAXBException, java.io.IOException
writeTo
in class SemanticProcessor
javax.xml.bind.JAXBException
java.io.IOException
public static NGram fromString(java.lang.String s) throws javax.xml.bind.JAXBException, java.io.UnsupportedEncodingException
javax.xml.bind.JAXBException
java.io.UnsupportedEncodingException
public java.lang.String toString()
toString
in class SemanticProcessor
public void check(boolean deep, java.lang.String errorContext) throws com.exalead.util.TypedException
check
in interface com.exalead.util.Checkable
check
in class SemanticProcessor
com.exalead.util.TypedException
public void accept(SemanticProcessor.Visitor visitor) throws com.exalead.util.TypedException
accept
in class SemanticProcessor
com.exalead.util.TypedException
public <T> T accept(SemanticProcessor.Transformer<T> transformer, T[] t) throws com.exalead.util.TypedException
accept
in class SemanticProcessor
com.exalead.util.TypedException
Copyright © 2013 Dassault Systèmes, All Rights Reserved.