Search in sources :

Example 1 with WorkflowInputEndOfQueueEntry

use of com.graphaware.nlp.workflow.input.WorkflowInputEndOfQueueEntry in project neo4j-nlp by graphaware.

the class WorkflowTextProcessor method handle.

@Override
public void handle(WorkflowInputEntry entry) {
    if (entry instanceof WorkflowInputEndOfQueueEntry) {
        super.checkAndHandle(new WorkflowProcessorEndOfQueueEntry());
        return;
    }
    if (isValid()) {
        AnnotatedText annotateText = NLPManager.getInstance().getTextProcessorsManager().annotate(entry.getText(), getConfiguration().getPipeline());
        super.checkAndHandle(new WorkflowProcessorOutputEntry(annotateText, entry.getId()));
    } else {
        LOG.warn("The Processor " + this.getName() + " is in an invalid state");
        return;
    }
}
Also used : AnnotatedText(com.graphaware.nlp.domain.AnnotatedText) WorkflowInputEndOfQueueEntry(com.graphaware.nlp.workflow.input.WorkflowInputEndOfQueueEntry)

Aggregations

AnnotatedText (com.graphaware.nlp.domain.AnnotatedText)1 WorkflowInputEndOfQueueEntry (com.graphaware.nlp.workflow.input.WorkflowInputEndOfQueueEntry)1