@Test public void countChars () { Note note = getNote(1L, "这是中文测试", "這是中文測試\n これは日本語のテストです"); assertEquals(24, new IdeogramsWordCounter().countChars(note)); }
@Override public int countChars (Note note) { String titleAndContent = note.getTitle() + "\n" + note.getContent(); return Observable .from(sanitizeTextForWordsAndCharsCount(note, titleAndContent).split("")) .filter(s -> !s.matches("\\s")) .count().toBlocking().single(); }
IdeogramsWordCounter implements WordCounter { @Override public int countChars (Note note) { String titleAndContent = note.getTitle() + "\n" + note.getContent(); return Observable .from(sanitizeTextForWordsAndCharsCount(note, titleAndContent).split("")) .filter(s -> !s.matches("\\s")) .count().toBlocking().single(); } }
IdeogramsWordCounter implements WordCounter { @Override public int countChars (Note note) { String titleAndContent = note.getTitle() + "\n" + note.getContent(); return Observable .from(sanitizeTextForWordsAndCharsCount(note, titleAndContent).split("")) .filter(s -> !s.matches("\\s")) .count().toBlocking().single(); }  }
IdeogramsWordCounter implements WordCounter { @Override public int countChars (Note note) { String titleAndContent = note.getTitle() + "\n" + note.getContent(); return Observable .from(sanitizeTextForWordsAndCharsCount(note, titleAndContent).split("")) .filter(s -> !s.matches("\\s")) .count().toBlocking().single(); }  @Override int countWords(Note note); @Override int countChars(Note note); }
IdeogramsWordCounter implements WordCounter { @Override public int countChars (Note note) { String titleAndContent = note.getTitle() + "\n" + note.getContent(); return Observable .from(sanitizeTextForWordsAndCharsCount(note, titleAndContent).split("")) .filter(s -> !s.matches("\\s")) .count().toBlocking().single(); }  @Override int countWords(Note note); @Override int countChars(Note note);  }