@Test public void testDoubleNewlines() { String text = "sentence.\n\nEEG:\nEEG Lorem ipsum dolor"; Document doc = DocumentFactory.fromText(text,DocumentFactory.Newlines.KEEP); Assert.assertEquals(text, doc.getText()); Assert.assertEquals("sentence.\n\n", doc.getSentence(0).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);  }