Operates On: Every lexical Item in the graph.
ResultsProducerStage stage = engine.getProducer("ProducerName"); String inputText = "This is a test entry"; Reader in = new StringReader(inputText); engine.reset(in); while(engine.advance() != null); List<String> output = (List<String>) producer.stream().collect(Collectors.toList());
"name": "JsonProducer", "onlyEntities": true, "queueTimeout": 10, "queueRetries": 1
If you have a text block like the following:
V----------[300 ml of water]----------V ^----------[300 ml of water]----------^ ^-[300]-V---[ml]---V--[of]--V-[water]-^ ^-[{#}]-^-[{unit}]-^-[have]-^ ^-[{measurement}]--^
the stage will produce the following JSON (if onlyEntities = true):
"entities":[{ "text":"300 ml", "value":[ { "value":"300", "entity":"#" }, { "value":"mililiters", "entity":"unit" } ], "entity":"measurement", "startPos":0, "endPos":6 }]
"tokens":[ { "text":"300 ml", "value":[ { "value":"300", "entity":"#" }, { "value":"mililiters", "entity":"unit" } ], "entity":"measurement", "startPos":0, "endPos":6 }, { "text":"of", "startPos":7, "endPos":9 }, { "text":"water", "startPos":10, "endPos":15 } ]