Package org.olat.core.commons.services.text.impl

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


          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++;
           
            DBFactory.getInstance().updateObject(message);
           
View Full Code Here


 
  public void testWordCount() {
    TextService languageService = new TextServiceImpl();
    for(TestTextCase.Text text:TestTextCase.getCases()) {
      Locale locale = new Locale(text.getLanguage());
      int words = languageService.wordCount(text.getText(), locale);
      assertTrue(words == text.getWords());
    }
  }
 
  public void testCharacterCount() {
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.