Examples of characterCount()


Examples of org.olat.core.commons.services.text.TextService.characterCount()

    String body = m.getBody();
    String unQuotedBody = new QuoteAndTagFilter().filter(body);
    TextService txtService = (TextService)ServiceFactory.getService(TextService.class);
    Locale suggestedLocale = txtService.detectLocale(unQuotedBody);
    m.setNumOfWords(txtService.wordCount(unQuotedBody, suggestedLocale));
    m.setNumOfCharacters(txtService.characterCount(unQuotedBody, suggestedLocale));
  }
}
View Full Code Here

Examples of org.olat.core.commons.services.text.TextService.characterCount()

        List<Message> allMessages = fMgr.getMessagesByForumID(forumKey);
        for (Message message : allMessages) {
          try{
            String body = message.getBody();
            Locale locale = languageService.detectLocale(body);
            int characters = languageService.characterCount(body, locale);
            message.setNumOfCharacters(characters);
            int words = languageService.wordCount(body, locale);
            message.setNumOfWords(words);
            counter++;
           
View Full Code Here

Examples of org.olat.core.commons.services.text.TextService.characterCount()

 
  public void testCharacterCount() {
    TextService languageService = new TextServiceImpl();
    for(TestTextCase.Text text:TestTextCase.getCases()) {
      Locale locale = new Locale(text.getLanguage());
      int characters = languageService.characterCount(text.getText(), locale);
      assertTrue(characters == text.getCharacters());
    }
  }
}
View Full Code Here

Examples of org.olat.core.commons.services.text.impl.TextServiceImpl.characterCount()

        List<Message> allMessages = fMgr.getMessagesByForumID(forumKey);
        for (Message message : allMessages) {
          try{
            String body = message.getBody();
            Locale locale = languageService.detectLocale(body);
            int characters = languageService.characterCount(body, locale);
            message.setNumOfCharacters(characters);
            int words = languageService.wordCount(body, locale);
            message.setNumOfWords(words);
            counter++;
           
View Full Code Here

Examples of org.olat.core.commons.services.text.impl.TextServiceImpl.characterCount()

 
  public void testCharacterCount() {
    TextService languageService = new TextServiceImpl();
    for(TestTextCase.Text text:TestTextCase.getCases()) {
      Locale locale = new Locale(text.getLanguage());
      int characters = languageService.characterCount(text.getText(), locale);
      assertTrue(characters == text.getCharacters());
    }
  }
}
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.