/** * Classify the contents of a String to a tagged word/class String. Plain text * or XML input is expected and the {@link PlainTextDocumentReaderAndWriter} * is used by default. * Output looks like: My/O name/O is/O Bill/PERSON Smith/PERSON ./O * * @param sentences * The String to be classified * @return A String annotated with classification information. */ public String classifyToString(String sentences) { return classifyToString(sentences, "slashTags", true); }
/** * Classify the contents of a {@link String}. Plain text or XML is expected * and the {@link PlainTextDocumentReaderAndWriter} is used by default. * The classifier will treat each sentence as a separate document. The output can be * specified to be in a choice of formats: Output is in inline XML format * (e.g., <PERSON>Bill Smith</PERSON> went to * <LOCATION>Paris</LOCATION> .) * * @param sentences The string to be classified * @return A {@link String} with annotated with classification information. */ public String classifyWithInlineXML(String sentences) { return classifyToString(sentences, "inlineXML", true); }
"I go to school at Stanford University, which is located in California." }; for (String str : example) { System.out.println(classifier.classifyToString(str)); System.out.print(classifier.classifyToString(str, "slashTags", false)); System.out.print(classifier.classifyToString(str, "tabbedEntities", false)); System.out.println(classifier.classifyToString(str, "xml", true)); System.out.print(classifier.classifyToString(str, "tsv", false));
if (! (input == null)) { String output = ner.classifyToString(input, ner.flags.outputFormat, !"slashTags".equals(ner.flags.outputFormat));
/** * Classify the contents of a String to a tagged word/class String. Plain text * or XML input is expected and the {@link PlainTextDocumentReaderAndWriter} * is used. Output looks like: My/O name/O is/O Bill/PERSON Smith/PERSON ./O * * @param sentences * The String to be classified * @return A String annotated with classification information. */ public String classifyToString(String sentences) { return classifyToString(sentences, "slashTags", true); }
/** * Classify the contents of a String to a tagged word/class String. Plain text * or XML input is expected and the {@link PlainTextDocumentReaderAndWriter} * is used by default. * Output looks like: My/O name/O is/O Bill/PERSON Smith/PERSON ./O * * @param sentences * The String to be classified * @return A String annotated with classification information. */ public String classifyToString(String sentences) { return classifyToString(sentences, "slashTags", true); }
/** * Classify the contents of a {@link String}. Plain text or XML is expected * and the {@link PlainTextDocumentReaderAndWriter} is used by default. * The classifier will treat each sentence as a separate document. The output can be * specified to be in a choice of formats: Output is in inline XML format * (e.g., <PERSON>Bill Smith</PERSON> went to * <LOCATION>Paris</LOCATION> .) * * @param sentences The string to be classified * @return A {@link String} with annotated with classification information. */ public String classifyWithInlineXML(String sentences) { return classifyToString(sentences, "inlineXML", true); }
/** * Classify the contents of a {@link String}. Plain text or XML is expected * and the {@link PlainTextDocumentReaderAndWriter} is used by default. The * classifier will treat each sentence as a separate document. The output * can be specified to be in a choice of formats: Output is in inline XML * format (e.g. <PERSON>Bill Smith</PERSON> went to * <LOCATION>Paris</LOCATION> .) * * @param sentences * The string to be classified * @return A {@link String} with annotated with classification information. */ public String classifyWithInlineXML(String sentences) { return classifyToString(sentences, "inlineXML", true); }
/** * Classify the contents of a String to a tagged word/class String. Plain * text or XML input is expected and the * {@link PlainTextDocumentReaderAndWriter} is used by default. Output looks * like: My/O name/O is/O Bill/PERSON Smith/PERSON ./O * * @param sentences * The String to be classified * @return A String annotated with classification information. */ public String classifyToString(String sentences) { return classifyToString(sentences, "slashTags", true); }
/** * Classify the contents of a {@link String}. Plain text or XML is expected * and the {@link PlainTextDocumentReaderAndWriter} is used. The classifier * will treat each sentence as a separate document. The output can be * specified to be in a choice of formats: Output is in inline XML format * (e.g. <PERSON>Bill Smith</PERSON> went to * <LOCATION>Paris</LOCATION> .) * * @param sentences * The string to be classified * @return A {@link String} with annotated with classification information. */ public String classifyWithInlineXML(String sentences) { return classifyToString(sentences, "inlineXML", true); }
if (! (input == null)) { String output = ner.classifyToString(input, ner.flags.outputFormat, !"slashTags".equals(ner.flags.outputFormat));