public abstract class MOTPipeInterface
extends com.exalead.gni.GNIObject
Modifier and Type | Field and Description |
---|---|
static int |
InvalidTID
Value of an invalid TID.
|
Constructor and Description |
---|
MOTPipeInterface() |
Modifier and Type | Method and Description |
---|---|
void |
disableAllProcessors()
Deprecated.
|
boolean |
disableProcessor(java.lang.String processorName)
Disable a processor.
|
void |
displayProfilingStats() |
void |
displayProfilingStats(java.lang.String title) |
void |
displayXML()
Pretty print the pipe in XML
|
boolean |
enableProcessor(java.lang.String processorName)
Enable a disabled processor.
|
void |
enableProfiling() |
void |
endDocument()
Tell the pipe we have finished the current document processing.
|
void |
feed(java.lang.String data,
int lang)
Feed the pipe with data.
|
Annotation[] |
getDocumentAnnotations()
Get annotations attached to the document.
|
AnnotatedToken[] |
getNextAnnotation(java.lang.String annotationKind)
"Fast forward" to the next token with an annotation of kind annotationKind.
|
AnnotatedToken[] |
getNextTokens(int howMany)
After a call to feed(), retrieve the n next produced tokens (at most).
|
Referential |
getReferential()
Retrieve a reference to the referential in use (JavaCustomTokenizer/SemanticProcessor)
|
java.lang.String |
getTag(int tid)
Get a tag from a TID.
|
int |
getTID(java.lang.String tag)
Get the TID associated to a tag.
|
int[] |
getTIDs(java.lang.String prefix)
Get a list of TIDs according to a prefix.
|
abstract boolean |
hasResourceGroupDependancy(java.lang.String groupName) |
void |
newDocument()
Tell the pipe we are going to process a new document.
|
void |
newDocument(java.lang.String uri)
Tell the pipe we are going to process a new document.
|
void |
newDocument(java.lang.String uri,
int lang)
Tell the pipe we are going to process a new document.
|
void |
newField(java.lang.String fieldName)
Tell the pipe we are going to process a field.
|
AnnotatedToken[] |
process(java.lang.String input,
int lang)
Process a chunk of text and return the annotated tokens.
|
AnnotatedToken[] |
process(java.lang.String input,
int lang,
int[] tids)
Process a chunk of text and return the annotated tokens.
|
AnnotatedToken[] |
process(java.lang.String input,
int lang,
int[] tids,
int timeoutMS)
Process a chunk of text and return the annotated tokens.
|
void |
processAllTokens()
Process all tokens available in the input stream without caring about their annotations.
|
AnnotatedToken[] |
processBytes(byte[] bytes,
int lang)
Process an array of bytes and returns the annotated tokens.
|
AnnotatedToken[] |
processBytes(byte[] bytes,
int lang,
int[] tids)
Process an array of bytes and returns the annotated tokens.
|
AnnotatedToken[] |
processBytes(byte[] bytes,
int lang,
int[] tids,
int timeoutMS)
Process an array of bytes and returns the annotated tokens.
|
AnnotatedToken[] |
processFeed()
Process the previously feeded chunk and return the annotated token.
|
AnnotatedToken[] |
processFeed(int[] tids)
Process the previously feeded chunk and return the annotated token
|
AnnotatedToken[] |
processFeed(int[] tids,
int timeoutMS)
Process the previously feeded chunk and return the annotated token.
|
void |
release()
Release the resources references by the pipe.
|
abstract void |
release(boolean finalizeElements)
Release the resources referenced by the pipe.
|
void |
setTimeout(long seconds)
Set a per-thread CPU-time limit for chunk processing
|
public static final int InvalidTID
public abstract void release(boolean finalizeElements)
finalizeElements
- If true, the processors, converters, and the
pipe itself are finalized.public void release()
public int getTID(java.lang.String tag)
tag
- The tag.public int[] getTIDs(java.lang.String prefix)
prefix
- The tags prefix.public java.lang.String getTag(int tid)
tid
- The tid.public Referential getReferential()
public void setTimeout(long seconds)
seconds
- CPU-time limit for processing a single feed, in secondspublic AnnotatedToken[] process(java.lang.String input, int lang, int[] tids, int timeoutMS)
input
- The chunk of text.lang
- The language to use.tids
- If not null, only the annotations having a TID present in this array will be retrieved.timeoutMS
- If greater than 0, the timeout.public AnnotatedToken[] process(java.lang.String input, int lang, int[] tids)
input
- The chunk of text.lang
- The language to use.tids
- If not null, only the annotations having a TID present in this array will be retrieved.public AnnotatedToken[] process(java.lang.String input, int lang)
input
- The chunk of text.lang
- The language to use.public AnnotatedToken[] processBytes(byte[] bytes, int lang, int[] tids, int timeoutMS)
bytes
- The bytes array.lang
- The language to use.tids
- If not null, only the annotations having a TID present in this array will be retrieved.timeoutMS
- If greater than 0, the timeout.public AnnotatedToken[] processBytes(byte[] bytes, int lang, int[] tids)
bytes
- The bytes array.lang
- The language to use.tids
- if not null, only the annotations having a TID present in this array will be retrievedpublic AnnotatedToken[] processBytes(byte[] bytes, int lang)
bytes
- The bytes array.lang
- The language to use.public void feed(java.lang.String data, int lang)
getNextAnnotation(java.lang.String)
public AnnotatedToken[] processFeed(int[] tids, int timeoutMS)
tids
- If not null, only the annotations having a TID present in this array will be retrieved.timeoutMS
- If greater than 0, the timeout.public AnnotatedToken[] processFeed(int[] tids)
tids
- if not null, only the annotations having a TID present in this array will be retrievedpublic AnnotatedToken[] processFeed()
public void newDocument(java.lang.String uri, int lang)
uri
- The optional document URI.lang
- The optional document language.public void newDocument(java.lang.String uri)
uri
- The optional document URI.public void newDocument()
public void endDocument()
public void newField(java.lang.String fieldName)
fieldName
- The field name.public boolean enableProcessor(java.lang.String processorName)
processorName
- The processor name.public boolean disableProcessor(java.lang.String processorName)
processorName
- The processor name.@Deprecated public void disableAllProcessors()
public AnnotatedToken[] getNextAnnotation(java.lang.String annotationKind)
public AnnotatedToken[] getNextTokens(int howMany)
public void processAllTokens()
public Annotation[] getDocumentAnnotations()
public void enableProfiling()
public void displayProfilingStats(java.lang.String title)
public void displayProfilingStats()
public void displayXML()
public abstract boolean hasResourceGroupDependancy(java.lang.String groupName)
Copyright © 2013 Dassault Systèmes, All Rights Reserved.