Package com.jgaap.util

Examples of com.jgaap.util.EventTrie


  public void train(List<Document> knownDocuments) throws AnalyzeException {
    windowSize = getParameter("windowSize", 15);
    authorModel = getParameter("model").equalsIgnoreCase("author");
    eventTries = new HashMap<String, EventTrie>();
    for(Document document : knownDocuments){
      EventTrie eventTrie = eventTries.get(identifier(document));
      if(eventTrie == null){
        eventTrie = new EventTrie();
        eventTries.put(identifier(document), eventTrie);
      }
      for(EventSet eventSet : document.getEventSets().values()) {
        for (int i = 0; i < eventSet.size(); i++) {
          EventSet dictionary;
          dictionary = window(eventSet, i, windowSize);
          eventTrie.add(dictionary);
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.jgaap.util.EventTrie

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.