@Test public void testEscapedChars() { String text = "Anah.\nAnah or Ana (, \"\u02be\u0100na\"), formerly also known as Anna, is an Iraqi town on the Euphrates river, approximately midway between the Gulf of Alexandretta and the Persian Gulf. Anah lies from west to east on the right bank along a bend of the river just before it turns south towards Hit.\nName.\nThe town is called Ha-na-at in a Babylonian letter around 2200\u00a0, A-na-at by the scribes of Tukulti-Ninurta \u00a0, and An-at by the scribes of Assur-nasir-pal II in 879\u00a0. The name has been connected with the widely worshipped war goddess Anat. It was known as \"Anath\u014d\" () to Isidore Charax and ' to Ammianus Marcellinus; early Arabic writers described it variously as \"\u02be\u0100na\" or (as if plural) \"\u02be\u0100n\u0101t\".\nAncient.\nDespite maintaining its name across 42 centuries, the exact location of the settlement seems to have moved from time to time. Sources across most of its early history, however, place Anah on an island in the Euphrates.\nIts early history under the Babylonians is uncertain. A 3rd-millennium\u00a0 letter mentions six \"men of Hanat\" are mentioned in a description of disturbances in the Residency of Suhi, which would have included the district of Anah. It is probably not the place mentioned by Amenhotep I in the 16th century\u00a0 or in the speech of Sennacherib's messengers to Hezekiah, but probably was the site \"in the middle of the Euphrates\" opposite which Assur-nasir-pal II halted during his 879\u00a0 campaign."; Document doc = DocumentFactory.fromText(text,DocumentFactory.Newlines.DISCARD); Assert.assertEquals(text.replace("\n", " ").replace("\u00a0", " "), doc.getText()); }
public static Document fromText(String text) { return instance.createFromText(text); }
DocumentFactory { public static Document fromText(String text) { return instance.createFromText(text); } }
DocumentFactory { public static Document fromText(String text) { return instance.createFromText(text); } DocumentFactory(); }
DocumentFactory { public static Document fromText(String text) { return instance.createFromText(text); } DocumentFactory(); static DocumentFactory getInstance(); static Document fromText(String text); static Document fromText(String text, Newlines newlines); static Document fromText(String text, Newlines newlines, WordHelpers.Language lang); static Document fromTokenizedText(String text); static Document fromTokens(List<Token> tokens); static List<Token> createTokensFromText(String text); static List<Token> createTokensFromTokenizedText(String text); static Sentence createSentenceFromTokens(List<Token> tokens); static Sentence createSentenceFromString(String text, String language); static Sentence createSentenceFromTokenizedString(String text); static String getLanguage(String text); Document createFromText(String text); Document createFromText(String text, Newlines newlines); Document createFromText(String text, Newlines newlines, WordHelpers.Language lang); void addToDocumentFromText(String text, Document doc, Newlines newlines); void addToDocumentFromText(String text, Document doc, Newlines newlines, String language); synchronized String detectLanguage(String text); Document createFromTokens(List<Token> tokens); List<Sentence> createSentencesFromTokens(List<Token> tokens); List<Sentence> createSentencesFromTokens(List<Token> tokens, String language); List<Token> createTokensFromText(String text, int offset); List<Token> createTokensFromText(String text, int offset, String language); List<Token> createTokensFromTokenizedText(String text, int offset); void retokenize(Document doc); }
DocumentFactory { public static Document fromText(String text) { return instance.createFromText(text); } DocumentFactory(); static DocumentFactory getInstance(); static Document fromText(String text); static Document fromText(String text, Newlines newlines); static Document fromText(String text, Newlines newlines, WordHelpers.Language lang); static Document fromTokenizedText(String text); static Document fromTokens(List<Token> tokens); static List<Token> createTokensFromText(String text); static List<Token> createTokensFromTokenizedText(String text); static Sentence createSentenceFromTokens(List<Token> tokens); static Sentence createSentenceFromString(String text, String language); static Sentence createSentenceFromTokenizedString(String text); static String getLanguage(String text); Document createFromText(String text); Document createFromText(String text, Newlines newlines); Document createFromText(String text, Newlines newlines, WordHelpers.Language lang); void addToDocumentFromText(String text, Document doc, Newlines newlines); void addToDocumentFromText(String text, Document doc, Newlines newlines, String language); synchronized String detectLanguage(String text); Document createFromTokens(List<Token> tokens); List<Sentence> createSentencesFromTokens(List<Token> tokens); List<Sentence> createSentencesFromTokens(List<Token> tokens, String language); List<Token> createTokensFromText(String text, int offset); List<Token> createTokensFromText(String text, int offset, String language); List<Token> createTokensFromTokenizedText(String text, int offset); void retokenize(Document doc);  }