To use the following code you'll need the next dependencies:
<dependency> <groupId>com.fasterxml.jackson.core</groupId> <artifactId>jackson-databind</artifactId> <version>{jackson-version}</version> </dependency>
Feel free to use your favorite JSON processing API.
This guide will include simple usage of REST services and the general documentation of this services can be found here.
Before coding a new example there are some things we are assuming.
There is a default pipeline, known as baseline-pipeline, with the following structure:
{ "stages": [ { "language": "en", "type": "TextBreakerStage" }, { "requiredFlags": [ "SENTENCE" ], "type": "WhitespaceTokenizerStage" }, { "type": "StopWordsStage" }, { "type": "CaseAnalysis" }, { "type": "CharChangeSplitter" } ] }
You can get information regarding the pipelines using the REST API. All we need for now is the name of the pipeline we need. To get a list of pipeline names we can use something like this: