### Question:
Tokenizer { public static Set<String> calculateWordNGrams(String string, int n) { return calculateAllWordNGrams(string, n, n); } private  Tokenizer(); static List<String> tokenize(String inputString); static Set<String> calculateCharNGrams(String string, int n); static Set<String> calculateAllCharEdgeNGrams(String string, int n1, int n2); static Set<String> calculateAllCharEdgeNGrams(String string, int n1, int n2, boolean mustHitLeftEdge); static Set<String> calculateCharEdgeNGrams(String string, int n, boolean mustHitLeftEdge); static Set<String> calculateWordNGrams(String string, int n); static List<String> calculateWordNGramsAsList(String string, int n); static Set<String> calculateAllCharNGrams(String string, int n1, int n2); static Set<String> calculateAllWordNGrams(String string, int n1, int n2); static Set<List<String>> computeSplits(String string, int n1, int n2, int maxSplits); static List<String> computeStartingWordNGrams(String string, int n1, int n2); static String getSentence(String string, int position); static List<String> getSentences(String inputText, boolean onlyRealSentences); static List<String> getSentences(String inputText, boolean onlyRealSentences, Language language); static List<String> getSentences(String inputText); static List<String> getSentences(String inputText, Language language); static String getPhraseFromBeginningOfSentence(String inputString); static String getPhraseToEndOfSentence(String string); static void main(String[] args); static final String TOKEN_SPLIT_REGEX; static final String SENTENCE_SPLIT_REGEX_EN; static final String SENTENCE_SPLIT_REGEX_DE; }### Answer:
@Test public void testCalculateWordNgrams() { assertEquals(1, Tokenizer.calculateAllWordNGrams("a++", 1, 10).size()); assertEquals(4, Tokenizer.calculateWordNGrams("Mr. A. Anderson.", 1).size()); assertEquals(4, Tokenizer.calculateWordNGrams("all the lilacs in ohio", 2).size()); assertEquals(3, Tokenizer.calculateWordNGrams("all the lilacs in ohio", 3).size()); assertEquals(2, Tokenizer.calculateWordNGrams("all the lilacs in ohio", 4).size()); assertEquals(1, Tokenizer.calculateWordNGrams("all the lilacs in ohio", 5).size()); assertEquals(0, Tokenizer.calculateWordNGrams("all the lilacs in ohio", 6).size()); assertEquals(4, Tokenizer.calculateWordNGrams("all the lilacs\n\n\nin ohio", 2).size()); }