public Annotation getAnnotation( String text, double confidence, int support, String ontologyTypesString, String sparqlQuery, String policy, boolean coreferenceResolution, String spotterName, String disambiguatorName, String clientIp) throws SearchException, InputException, ItemNotFoundException, SpottingException, MalformedURLException, BoilerpipeProcessingException { LOG.info("******************************** Parameters ********************************"); // announceAPI(); boolean blacklist = false; if (policy.trim().equalsIgnoreCase("blacklist")) { blacklist = true; policy = "blacklist"; } else { policy = "whitelist"; } LOG.info("client ip: " + clientIp); LOG.info("text to be processed: " + text); LOG.info("text length in chars: " + text.length()); LOG.info("confidence: " + String.valueOf(confidence)); LOG.info("support: " + String.valueOf(support)); LOG.info("types: " + ontologyTypesString); LOG.info("sparqlQuery: " + sparqlQuery); LOG.info("policy: " + policy); LOG.info("coreferenceResolution: " + String.valueOf(coreferenceResolution)); LOG.info("spotter: " + spotterName); LOG.info("disambiguator: " + disambiguatorName); /* Validating parameters */ if (text.trim().equals("")) { throw new InputException("No text was specified in the &text parameter."); } /* Setting defaults */ if (Server.getTokenizer() == null && disambiguatorName == SpotlightConfiguration.DisambiguationPolicy.Default.name() && text.length() > 1200) { disambiguatorName = SpotlightConfiguration.DisambiguationPolicy.Document.name(); LOG.info( String.format( "Text length: %d. Using %s to disambiguate.", text.length(), disambiguatorName)); } Spotter spotter = Server.getSpotter(spotterName); ParagraphDisambiguatorJ disambiguator = Server.getDisambiguator(disambiguatorName); /* Running Annotation */ Annotation annotation = process( text, confidence, support, ontologyTypesString, sparqlQuery, blacklist, coreferenceResolution, spotter, disambiguator); LOG.debug("Shown: " + annotation.toXML()); LOG.debug("****************************************************************"); return annotation; }