@Test public void getTokensForTextTest() throws ApiException, JsonProcessingException { PosTag[] tags = {PosTag.DT, PosTag.JJS}; int count = 4; String expectedPosTags = PosTag.DT.getLabel() + "," + PosTag.JJS.getLabel(); when(textApi.getTokensForText(eq(TEXT), eq(expectedPosTags), eq(NOT_NULL_RETINA))).thenReturn(createStrings(count)); List<String> tokens = textRetinaApiImpl.getTokens(TEXT, tags); assertEquals(count, tokens.size()); verify(textApi, times(1)).getTokensForText(eq(TEXT), eq(expectedPosTags), eq(NOT_NULL_RETINA)); }
@Override public List<String> getTokens(String text, PosTag[] posTags) throws ApiException { if (isEmpty(text)) { throw new IllegalArgumentException(NULL_TEXT_MSG); } LOG.debug("Retrieve tokens for the text: " + text); return this.api.getTokensForText(text, cluePosTags(posTags), retinaName); }
TextRetinaApiImpl extends BaseRetinaApi implements Texts { @Override public List<String> getTokens(String text, PosTag[] posTags) throws ApiException { if (isEmpty(text)) { throw new IllegalArgumentException(NULL_TEXT_MSG); } LOG.debug("Retrieve tokens for the text: " + text); return this.api.getTokensForText(text, cluePosTags(posTags), retinaName); } }
TextRetinaApiImpl extends BaseRetinaApi implements Texts { @Override public List<String> getTokens(String text, PosTag[] posTags) throws ApiException { if (isEmpty(text)) { throw new IllegalArgumentException(NULL_TEXT_MSG); } LOG.debug("Retrieve tokens for the text: " + text); return this.api.getTokensForText(text, cluePosTags(posTags), retinaName); } TextRetinaApiImpl(String apiKey, String basePath, String retinaName);   TextRetinaApiImpl(final TextApi api, String retinaName); }
TextRetinaApiImpl extends BaseRetinaApi implements Texts { @Override public List<String> getTokens(String text, PosTag[] posTags) throws ApiException { if (isEmpty(text)) { throw new IllegalArgumentException(NULL_TEXT_MSG); } LOG.debug("Retrieve tokens for the text: " + text); return this.api.getTokensForText(text, cluePosTags(posTags), retinaName); } TextRetinaApiImpl(String apiKey, String basePath, String retinaName);   TextRetinaApiImpl(final TextApi api, String retinaName); @Override List<String> getKeywords(String text); @Override List<Fingerprint> getFingerprints(String text); @Override List<Fingerprint> getFingerprintBulk(Double sparsity, Text... texts); @Override List<Text> getSlices(String text, Pagination pagination, Boolean includeFingerprint); @Override List<String> getTokens(String text, PosTag[] posTags); @Override List<Text> getSlices(String text, Boolean includeFingerprint); @Override List<Text> getSlices(String text); @Override Retina identifyRetinaByText(String text); }
TextRetinaApiImpl extends BaseRetinaApi implements Texts { @Override public List<String> getTokens(String text, PosTag[] posTags) throws ApiException { if (isEmpty(text)) { throw new IllegalArgumentException(NULL_TEXT_MSG); } LOG.debug("Retrieve tokens for the text: " + text); return this.api.getTokensForText(text, cluePosTags(posTags), retinaName); } TextRetinaApiImpl(String apiKey, String basePath, String retinaName);   TextRetinaApiImpl(final TextApi api, String retinaName); @Override List<String> getKeywords(String text); @Override List<Fingerprint> getFingerprints(String text); @Override List<Fingerprint> getFingerprintBulk(Double sparsity, Text... texts); @Override List<Text> getSlices(String text, Pagination pagination, Boolean includeFingerprint); @Override List<String> getTokens(String text, PosTag[] posTags); @Override List<Text> getSlices(String text, Boolean includeFingerprint); @Override List<Text> getSlices(String text); @Override Retina identifyRetinaByText(String text);  }