public class SemanticExtractor extends SemanticProcessor implements com.exalead.util.Checkable, java.io.Serializable
SemanticProcessor.Transformer<T>, SemanticProcessor.Visitor
Modifier and Type | Field and Description |
---|---|
boolean |
allowOverlap |
java.lang.String |
annotateUnusedTokensWith |
boolean |
breakOnLine |
boolean |
breakOnParagraph |
boolean |
breakOnSentence |
static boolean |
DEFAULT_ALLOW_OVERLAP |
static boolean |
DEFAULT_BREAK_ON_LINE |
static boolean |
DEFAULT_BREAK_ON_PARAGRAPH |
static boolean |
DEFAULT_BREAK_ON_SENTENCE |
static boolean |
DEFAULT_MATCH_ALL_RULES |
java.lang.String |
language |
boolean |
matchAllRules |
java.lang.String |
prefix |
java.lang.String |
resourceDir |
contexts, name, src
Constructor and Description |
---|
SemanticExtractor() |
SemanticExtractor(SemanticExtractor 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 SemanticExtractor.
|
static SemanticExtractor |
fromString(java.lang.String s)
String representation of this SemanticExtractor.
|
java.lang.String |
getAnnotateUnusedTokensWith()
The annotation to set on the non-matching part of the input for postprocessing
|
java.lang.String |
getLanguage()
Language for which the extractor is activated.
If null, all languages are activated. |
java.lang.String |
getPrefix()
Output annotations prefix
|
java.lang.String |
getResourceDir()
URL for the resource (data://, file:// or resource://)
|
boolean |
isAllowOverlap()
If true, reports matches from different rules even if they overlap
|
boolean |
isBreakOnLine()
If true: maximum one match per line, no match inter-line.
|
boolean |
isBreakOnParagraph()
If true: maximum one match per paragraph, no match inter-paragraph.
|
boolean |
isBreakOnSentence()
If true: maximum one match per sentence, no match inter-sentence.
(will add SentenceFinder automatically). |
boolean |
isMatchAllRules()
Returns the full list of matched rules.
If false, returns only the first matched rule. |
SemanticExtractor |
makeCopy()
Creates and returns a deep copy of this SemanticExtractor.
|
static SemanticExtractor |
readFrom(java.io.InputStream is)
Read this SemanticExtractor from an XML fragment.
|
void |
setAllowOverlap(boolean allowOverlap)
If true, reports matches from different rules even if they overlap
|
void |
setAnnotateUnusedTokensWith(java.lang.String annotateUnusedTokensWith)
The annotation to set on the non-matching part of the input for postprocessing
|
void |
setBreakOnLine(boolean breakOnLine)
If true: maximum one match per line, no match inter-line.
|
void |
setBreakOnParagraph(boolean breakOnParagraph)
If true: maximum one match per paragraph, no match inter-paragraph.
|
void |
setBreakOnSentence(boolean breakOnSentence)
If true: maximum one match per sentence, no match inter-sentence.
(will add SentenceFinder automatically). |
void |
setLanguage(java.lang.String language)
Language for which the extractor is activated.
If null, all languages are activated. |
void |
setMatchAllRules(boolean matchAllRules)
Returns the full list of matched rules.
If false, returns only the first matched rule. |
void |
setPrefix(java.lang.String prefix)
Output annotations prefix
|
void |
setResourceDir(java.lang.String resourceDir)
URL for the resource (data://, file:// or resource://)
|
java.lang.String |
toString()
String representation of this SemanticExtractor.
|
SemanticExtractor |
withAllowOverlap(boolean allowOverlap) |
SemanticExtractor |
withAllowOverlap(java.lang.Boolean allowOverlap) |
SemanticExtractor |
withAnnotateUnusedTokensWith(java.lang.String annotateUnusedTokensWith) |
SemanticExtractor |
withBreakOnLine(boolean breakOnLine) |
SemanticExtractor |
withBreakOnLine(java.lang.Boolean breakOnLine) |
SemanticExtractor |
withBreakOnParagraph(boolean breakOnParagraph) |
SemanticExtractor |
withBreakOnParagraph(java.lang.Boolean breakOnParagraph) |
SemanticExtractor |
withBreakOnSentence(boolean breakOnSentence) |
SemanticExtractor |
withBreakOnSentence(java.lang.Boolean breakOnSentence) |
SemanticExtractor |
withContexts(java.lang.String contexts) |
SemanticExtractor |
withLanguage(java.lang.String language) |
SemanticExtractor |
withMatchAllRules(boolean matchAllRules) |
SemanticExtractor |
withMatchAllRules(java.lang.Boolean matchAllRules) |
SemanticExtractor |
withName(java.lang.String name) |
SemanticExtractor |
withPrefix(java.lang.String prefix) |
SemanticExtractor |
withResourceDir(java.lang.String resourceDir) |
SemanticExtractor |
withSrc(java.lang.String src)
Deprecated.
|
void |
writeTo(java.io.OutputStream os)
Write this SemanticExtractor as an XML fragment
|
getContexts, getName, getSrc, setContexts, setName, setSrc
public java.lang.String resourceDir
public java.lang.String language
public java.lang.String prefix
public boolean breakOnSentence
public static final boolean DEFAULT_BREAK_ON_SENTENCE
public boolean breakOnParagraph
public static final boolean DEFAULT_BREAK_ON_PARAGRAPH
public boolean breakOnLine
public static final boolean DEFAULT_BREAK_ON_LINE
public boolean matchAllRules
public static final boolean DEFAULT_MATCH_ALL_RULES
public java.lang.String annotateUnusedTokensWith
public boolean allowOverlap
public static final boolean DEFAULT_ALLOW_OVERLAP
public SemanticExtractor()
public SemanticExtractor(SemanticExtractor o)
public SemanticExtractor withName(java.lang.String name)
withName
in class SemanticProcessor
public SemanticExtractor withContexts(java.lang.String contexts)
withContexts
in class SemanticProcessor
@Deprecated public SemanticExtractor withSrc(java.lang.String src)
withSrc
in class SemanticProcessor
public void setResourceDir(java.lang.String resourceDir)
public java.lang.String getResourceDir()
public SemanticExtractor withResourceDir(java.lang.String resourceDir)
public void setLanguage(java.lang.String language)
public java.lang.String getLanguage()
public SemanticExtractor withLanguage(java.lang.String language)
public void setPrefix(java.lang.String prefix)
public java.lang.String getPrefix()
public SemanticExtractor withPrefix(java.lang.String prefix)
public void setBreakOnSentence(boolean breakOnSentence)
public boolean isBreakOnSentence()
public SemanticExtractor withBreakOnSentence(boolean breakOnSentence)
public SemanticExtractor withBreakOnSentence(java.lang.Boolean breakOnSentence)
public void setBreakOnParagraph(boolean breakOnParagraph)
public boolean isBreakOnParagraph()
public SemanticExtractor withBreakOnParagraph(boolean breakOnParagraph)
public SemanticExtractor withBreakOnParagraph(java.lang.Boolean breakOnParagraph)
public void setBreakOnLine(boolean breakOnLine)
public boolean isBreakOnLine()
public SemanticExtractor withBreakOnLine(boolean breakOnLine)
public SemanticExtractor withBreakOnLine(java.lang.Boolean breakOnLine)
public void setMatchAllRules(boolean matchAllRules)
public boolean isMatchAllRules()
public SemanticExtractor withMatchAllRules(boolean matchAllRules)
public SemanticExtractor withMatchAllRules(java.lang.Boolean matchAllRules)
public void setAnnotateUnusedTokensWith(java.lang.String annotateUnusedTokensWith)
public java.lang.String getAnnotateUnusedTokensWith()
public SemanticExtractor withAnnotateUnusedTokensWith(java.lang.String annotateUnusedTokensWith)
public void setAllowOverlap(boolean allowOverlap)
public boolean isAllowOverlap()
public SemanticExtractor withAllowOverlap(boolean allowOverlap)
public SemanticExtractor withAllowOverlap(java.lang.Boolean allowOverlap)
public SemanticExtractor makeCopy()
makeCopy
in class SemanticProcessor
public static SemanticExtractor 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 SemanticExtractor 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.