Examples of wordCount()


Examples of com.github.pmerienne.trident.ml.nlp.Vocabulary.wordCount()

    // When
    vocabulary.limitWords(3);

    // Then
    assertEquals(3, vocabulary.wordCount().intValue());
    assertEquals(0, vocabulary.count("we are 1").intValue());
    assertEquals(0, vocabulary.count("we are 2").intValue());
    assertEquals(3, vocabulary.count("we are 3").intValue());
    assertEquals(4, vocabulary.count("we are 4").intValue());
    assertEquals(5, vocabulary.count("we are 5").intValue());
View Full Code Here

Examples of net.yacy.kelondro.data.meta.URIMetadataRow.wordCount()

                    } else
                        prop.put("table_indexed_" + cnt + "_showDate", "0");

                    if (showWords && urle != null) {
                        prop.put("table_indexed_" + cnt + "_showWords", "1");
                        prop.put("table_indexed_" + cnt + "_showWords_count", urle.wordCount());
                    } else
                        prop.put("table_indexed_" + cnt + "_showWords", "0");

                    if (showTitle) {
                        prop.put("table_indexed_" + cnt + "_showTitle", (showTitle) ? "1" : "0");
View Full Code Here

Examples of net.yacy.kelondro.data.meta.URIMetadataRow.wordCount()

          metadata.put(METADATA.SIZE, String.valueOf(urlEntry.size()));
          metadata.put(METADATA.FRESHDATE, ISO8601Formatter.FORMATTER.format(urlEntry.freshdate()));
          metadata.put(METADATA.LOADDATE, ISO8601Formatter.FORMATTER.format(urlEntry.loaddate()));
          metadata.put(METADATA.MODDATE, ISO8601Formatter.FORMATTER.format(urlEntry.moddate()));
          metadata.put(METADATA.SNIPPET, String.valueOf(urlEntry.snippet()));
          metadata.put(METADATA.WORDCOUNT, String.valueOf(urlEntry.wordCount()));
          metadata.put(METADATA.MIMETYPE, String.valueOf(urlEntry.doctype()));
          metadata.put(METADATA.LANGUAGE, UTF8.String(urlEntry.language()));

          final URIMetadataRow.Components meta = urlEntry.metadata();
          if (meta != null) {
View Full Code Here

Examples of net.yacy.kelondro.data.meta.URIMetadataRow.wordCount()

                    } else
                        prop.put("table_indexed_" + cnt + "_showDate", "0");

                    if (showWords && urle != null) {
                        prop.put("table_indexed_" + cnt + "_showWords", "1");
                        prop.put("table_indexed_" + cnt + "_showWords_count", urle.wordCount());
                    } else
                        prop.put("table_indexed_" + cnt + "_showWords", "0");

                    if (showTitle) {
                        prop.put("table_indexed_" + cnt + "_showTitle", (showTitle) ? "1" : "0");
View Full Code Here

Examples of net.yacy.kelondro.data.meta.URIMetadataRow.wordCount()

          metadata.put(METADATA.SIZE, String.valueOf(urlEntry.size()));
          metadata.put(METADATA.FRESHDATE, ISO8601Formatter.FORMATTER.format(urlEntry.freshdate()));
          metadata.put(METADATA.LOADDATE, ISO8601Formatter.FORMATTER.format(urlEntry.loaddate()));
          metadata.put(METADATA.MODDATE, ISO8601Formatter.FORMATTER.format(urlEntry.moddate()));
          metadata.put(METADATA.SNIPPET, String.valueOf(urlEntry.snippet()));
          metadata.put(METADATA.WORDCOUNT, String.valueOf(urlEntry.wordCount()));
          metadata.put(METADATA.MIMETYPE, String.valueOf(urlEntry.doctype()));
          metadata.put(METADATA.LANGUAGE, UTF8.String(urlEntry.language()));

          final URIMetadataRow.Components meta = urlEntry.metadata();
          if (meta != null) {
View Full Code Here

Examples of org.apache.gora.examples.mapreduce.WordCount.wordCount()

    //create input
    WebPageDataCreator.createWebPageData(inStore);
   
    //run the job
    WordCount wordCount = new WordCount(conf);
    wordCount.wordCount(inStore, outStore);
   
    //assert results
    HashMap<String, Integer> actualCounts = new HashMap<String, Integer>();
    for(String content : WebPageDataCreator.CONTENTS) {
      for(String token:content.split(" ")) {
View Full Code Here

Examples of org.apache.gora.examples.mapreduce.WordCount.wordCount()

    //create input
    WebPageDataCreator.createWebPageData(inStore);
   
    //run the job
    WordCount wordCount = new WordCount(conf);
    wordCount.wordCount(inStore, outStore);
   
    //assert results
    HashMap<String, Integer> actualCounts = new HashMap<String, Integer>();
    for(String content : WebPageDataCreator.CONTENTS) {
      for(String token:content.split(" ")) {
View Full Code Here

Examples of org.apache.gora.examples.mapreduce.WordCount.wordCount()

    //create input
    WebPageDataCreator.createWebPageData(inStore);
   
    //run the job
    WordCount wordCount = new WordCount(conf);
    wordCount.wordCount(inStore, outStore);
   
    //assert results
    HashMap<String, Integer> actualCounts = new HashMap<String, Integer>();
    for(String content : WebPageDataCreator.CONTENTS) {
      for(String token:content.split(" ")) {
View Full Code Here

Examples of org.apache.gora.examples.mapreduce.WordCount.wordCount()

    //create input
    WebPageDataCreator.createWebPageData(inStore);
   
    //run the job
    WordCount wordCount = new WordCount(conf);
    wordCount.wordCount(inStore, outStore);
   
    //assert results
    HashMap<String, Integer> actualCounts = new HashMap<String, Integer>();
    for(String content : WebPageDataCreator.CONTENTS) {
      if (content != null) {
View Full Code Here

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

  public void updateCounters(Message m) {
    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
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.