public class SemanticExtractor extends SemanticProcessor implements com.exalead.util.Checkable, java.io.Serializable
SemanticProcessor.FromDataModel, SemanticProcessor.Transformer<T>, SemanticProcessor.Visitor
Modifier and Type | Field and Description |
---|---|
java.lang.String |
annotateUnusedTokensWith |
boolean |
breakOnLine |
boolean |
breakOnParagraph |
boolean |
breakOnSentence |
static boolean |
DEFAULT_BREAK_ON_LINE |
static boolean |
DEFAULT_BREAK_ON_PARAGRAPH |
static boolean |
DEFAULT_BREAK_ON_SENTENCE |
static boolean |
DEFAULT_MATCH_ALL_RULES |
static boolean |
DEFAULT_OVERLAPPING_MATCHES |
java.lang.String |
language |
boolean |
matchAllRules |
boolean |
overlappingMatches |
java.lang.String |
prefix |
java.lang.String |
resourceDir |
contexts, dataModelClass, dataModelProperty, dataModelState, DEFAULT_DISABLED, disabled, fromDataModel, name
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()
Used in the context of query rewriting by the Semantic Query Analyzer.
|
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 of the compiled semantic extractor file.
|
boolean |
isBreakOnLine()
If true, there will be maximum one match per line, and no match for inter-line.
|
boolean |
isBreakOnParagraph()
If true, there will be maximum one match per paragraph, and no match for inter-paragraph.
|
boolean |
isBreakOnSentence()
If true, there will be maximum one match per sentence, and no match for inter-sentence.
This option will add the SentenceFinder automatically. |
boolean |
isMatchAllRules()
If true, it returns the full list of matched rules.
If false, it returns only the first matched rule. |
boolean |
isOverlappingMatches()
If true, reports all matches even if their locations overlap.
Only makes sense when matchAllRules is true. |
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 |
setAnnotateUnusedTokensWith(java.lang.String annotateUnusedTokensWith)
Used in the context of query rewriting by the Semantic Query Analyzer.
|
void |
setBreakOnLine(boolean breakOnLine)
If true, there will be maximum one match per line, and no match for inter-line.
|
void |
setBreakOnParagraph(boolean breakOnParagraph)
If true, there will be maximum one match per paragraph, and no match for inter-paragraph.
|
void |
setBreakOnSentence(boolean breakOnSentence)
If true, there will be maximum one match per sentence, and no match for inter-sentence.
This option will add the 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)
If true, it returns the full list of matched rules.
If false, it returns only the first matched rule. |
void |
setOverlappingMatches(boolean overlappingMatches)
If true, reports all matches even if their locations overlap.
Only makes sense when matchAllRules is true. |
void |
setPrefix(java.lang.String prefix)
Output annotations prefix
|
void |
setResourceDir(java.lang.String resourceDir)
URL of the compiled semantic extractor file.
|
java.lang.String |
toString()
String representation of this SemanticExtractor.
|
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 |
withDataModelClass(java.lang.String dataModelClass) |
SemanticExtractor |
withDataModelProperty(java.lang.String dataModelProperty) |
SemanticExtractor |
withDataModelState(java.lang.String dataModelState) |
SemanticExtractor |
withDisabled(boolean disabled) |
SemanticExtractor |
withDisabled(java.lang.Boolean disabled) |
SemanticExtractor |
withFromDataModel(SemanticProcessor fromDataModel) |
SemanticExtractor |
withLanguage(java.lang.String language) |
SemanticExtractor |
withMatchAllRules(boolean matchAllRules) |
SemanticExtractor |
withMatchAllRules(java.lang.Boolean matchAllRules) |
SemanticExtractor |
withName(java.lang.String name) |
SemanticExtractor |
withOverlappingMatches(boolean overlappingMatches) |
SemanticExtractor |
withOverlappingMatches(java.lang.Boolean overlappingMatches) |
SemanticExtractor |
withPrefix(java.lang.String prefix) |
SemanticExtractor |
withResourceDir(java.lang.String resourceDir) |
void |
writeTo(java.io.OutputStream os)
Write this SemanticExtractor as an XML fragment
|
getContexts, getDataModelClass, getDataModelProperty, getDataModelState, getFromDataModel, getName, isDisabled, setContexts, setDataModelClass, setDataModelProperty, setDataModelState, setDisabled, setFromDataModel, setName
public java.lang.String resourceDir
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 language
public java.lang.String annotateUnusedTokensWith
public boolean overlappingMatches
public static final boolean DEFAULT_OVERLAPPING_MATCHES
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
public SemanticExtractor withFromDataModel(SemanticProcessor fromDataModel)
public SemanticExtractor withDataModelState(java.lang.String dataModelState)
withDataModelState
in class SemanticProcessor
public SemanticExtractor withDataModelClass(java.lang.String dataModelClass)
withDataModelClass
in class SemanticProcessor
public SemanticExtractor withDataModelProperty(java.lang.String dataModelProperty)
withDataModelProperty
in class SemanticProcessor
public SemanticExtractor withDisabled(boolean disabled)
withDisabled
in class SemanticProcessor
public SemanticExtractor withDisabled(java.lang.Boolean disabled)
withDisabled
in class SemanticProcessor
public void setResourceDir(java.lang.String resourceDir)
public java.lang.String getResourceDir()
public SemanticExtractor withResourceDir(java.lang.String resourceDir)
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 setLanguage(java.lang.String language)
public java.lang.String getLanguage()
public SemanticExtractor withLanguage(java.lang.String language)
public void setAnnotateUnusedTokensWith(java.lang.String annotateUnusedTokensWith)
public java.lang.String getAnnotateUnusedTokensWith()
public SemanticExtractor withAnnotateUnusedTokensWith(java.lang.String annotateUnusedTokensWith)
public void setOverlappingMatches(boolean overlappingMatches)
public boolean isOverlappingMatches()
public SemanticExtractor withOverlappingMatches(boolean overlappingMatches)
public SemanticExtractor withOverlappingMatches(java.lang.Boolean overlappingMatches)
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 © 2021 Dassault Systèmes, All Rights Reserved.