Package com.jgaap.util

Examples of com.jgaap.util.NumericEventSet


  public String vowellist = "aeiouyAEIOUY";

  @Override
  public NumericEventSet createEventSet(char[] text) throws EventGenerationException {
    EventSet es = wordtokenizer.createEventSet(text);
    NumericEventSet newEs = new NumericEventSet();

    for (int i = 0; i < es.size(); i++) {
      String s = (es.eventAt(i)).toString();
      int l = 0;
      for (int j = 0; j < s.length(); j++) {
        if ((vowellist.indexOf(s.charAt(j)) != -1)
            && ((j == s.length() - 1) || (vowellist.indexOf(s.charAt(j + 1)) == -1))) {
          l++;
        }
      }
      if (l == 0) {
        l = 1; // handle words like "Dr" by setting to 1
      }
      newEs.addEvent(new Event(String.valueOf(l), this));
    }
    return newEs;
  }
View Full Code Here

TOP

Related Classes of com.jgaap.util.NumericEventSet

Copyright © 2018 www.massapicom. 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.