Package com.jgaap.generics

Examples of com.jgaap.generics.EventDriver


      /*DisLegomenaEventDriver - Returns only events that occur twice*/
      /*Test One - Normal Text w/ one event to return*/

    String text = ("The Quick Brown Fox Jumped Over The Lazy Dog 3 3 3 4 4 4 4 5 5 5 5 5");

      EventDriver eventDriver = new RareWordsEventDriver();
      eventDriver.setParameter("M", 2);
      eventDriver.setParameter("N", 2);
     
      EventSet sampleSet = eventDriver.createEventSet(text.toCharArray());
     
      EventSet expectedSet = new EventSet();
      Vector<Event> tmp = new Vector<Event>();
      tmp.add(new Event("The", eventDriver));
      tmp.add(new Event("The", eventDriver));
View Full Code Here


    /* test case 1 -- no punctuation */
    String text = (
"a aah Aaron aback abacus abandon abandoned zones zoning zoo " +
"zoologist zoology zoom zooming zooms zucchini Zurich");

    EventDriver eventDriver = new TruncatedFreqEventDriver();
    EventSet sampleEventSet = eventDriver.createEventSet(text.toCharArray());
    EventSet expectedEventSet = new NumericEventSet();
    Vector<Event> tmp = new Vector<Event>();

    tmp.add(new Event("16.", eventDriver));
    tmp.add(new Event("5.4", eventDriver));
View Full Code Here

    /* test case 1 -- no punctuation */
    String text = (
"test test test tested testers happiest test test test"
    );

    EventDriver eventDriver = new SuffixEventDriver();
    EventSet sampleEventSet = eventDriver.createEventSet(text.toCharArray());
    EventSet expectedEventSet = new EventSet();
    Vector<Event> tmp = new Vector<Event>();

    tmp.add(new Event("ted", eventDriver));
    tmp.add(new Event("ers", eventDriver));
View Full Code Here

"1 22 333 4444 55555 " +
"! @@ ### $$$$ %%%%% " +
"A BB CCC DDDD EEEEE "
    );

    EventDriver eventDriver = new MNLetterWordEventDriver();
    eventDriver.setParameter("M", 2);
    eventDriver.setParameter("N", 4);
   
    EventSet sampleEventSet = eventDriver.createEventSet(text.toCharArray());
    EventSet expectedEventSet = new EventSet();
    Vector<Event> tmp = new Vector<Event>();

    tmp.add(new Event("bb", eventDriver));
    tmp.add(new Event("ccc", eventDriver));
View Full Code Here

"accomplished accomplishing accomplishment accompt accord accordant accorded "+
"accordeth according accordingly accords accost accosted account accountant "+
"accounted accounts accoutred accoutrement accoutrements accrue");


    EventDriver eventDriver = new PorterStemmerEventDriver();
    EventSet sampleEventSet = eventDriver.createEventSet(text.toCharArray());
    EventSet expectedEventSet = new EventSet();
    Vector<Event> tmp = new Vector<Event>();

    tmp.add(new Event("test", eventDriver));
    tmp.add(new Event("Test", eventDriver));
View Full Code Here

                   "who kept all his cash in a bucket , " +
                   "but his daughter, named Nan , " +
                   "ran away with a man, " +
                   "and as for the bucket, Nantucket .");
     
        EventDriver eventDriver = new POSNGramEventDriver();
        eventDriver.setParameter("N", 2);
       
        EventSet sampleSet = eventDriver.createEventSet(text.toCharArray());
        //System.out.println(sampleSet.size());
        //System.out.println(sampleSet.toString());
       
       
        EventSet expectedSet = new EventSet();
View Full Code Here

      "EIEIO " +   // 1 syllable
      "EieIOo " +   // 1 syllable
      "OTTO "   // 2 syllables
    );

    EventDriver eventDriver = new SyllableTransitionEventDriver();
    EventSet sampleEventSet = eventDriver.createEventSet(text.toCharArray());
    EventSet expectedEventSet = new EventSet();
    Vector<Event> tmp = new Vector<Event>();
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 2]", eventDriver));
    tmp.add(new Event("[2, 2]", eventDriver));
    tmp.add(new Event("[2, 2]", eventDriver));
    tmp.add(new Event("[2, 2]", eventDriver));
    tmp.add(new Event("[2, 3]", eventDriver));
    tmp.add(new Event("[3, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 1]", eventDriver));
    tmp.add(new Event("[1, 2]", eventDriver));

    expectedEventSet.addEvents(tmp);
    System.out.println(expectedEventSet.toString());
    System.out.println(sampleEventSet.toString());
    assertTrue(expectedEventSet.equals(sampleEventSet));

    /* test case 2 -- trigrams */
    EventDriver ed = new SyllableTransitionEventDriver();
    ed.setParameter("N","3");
    sampleEventSet = ed.createEventSet(text.toCharArray());

    expectedEventSet = new EventSet();
    tmp = new Vector<Event>();

    tmp.add(new Event("[1, 1, 1]", ed));
View Full Code Here

"1 22 333 4444 55555 " +
"! @@ ### $$$$ %%%%% "
    );


    EventDriver eventDriver = new VowelMNLetterWordEventDriver();
    eventDriver.setParameter("M", 2);
    eventDriver.setParameter("N", 4);

    EventSet sampleEventSet = eventDriver.createEventSet(text.toCharArray());
    EventSet expectedEventSet = new EventSet();
    Vector<Event> tmp = new Vector<Event>();

    tmp.add(new Event("aa", eventDriver));
    tmp.add(new Event("ee", eventDriver));
View Full Code Here

    /* test case 1 -- no punctuation */
    String text = (
"a aah Aaron aback abacus abandon abandoned zones zoning zoo " +
"zoologist zoology zoom zooming zooms zucchini Zurich");

    EventDriver eventDriver = new ReactionTimeEventDriver();
    EventSet sampleEventSet = eventDriver.createEventSet(text.toCharArray());
    EventSet expectedEventSet = new NumericEventSet();
    Vector<Event> tmp = new Vector<Event>();

    tmp.add(new Event("798.92", eventDriver));
    tmp.add(new Event("816.43", eventDriver));
View Full Code Here

      /*HDLegomenaEventDriver - Returns only events that occurs once or twice*/
      /*Test One - Normal Text w/ one or two events to return*/

    String text = ("Jack be nimble, Jack be quick, Jack jump over the candlestick.");
     
      EventDriver eventDriver = new RareWordsEventDriver();
      eventDriver.setParameter("M", 1);
      eventDriver.setParameter("N", 2);
     
      EventSet sampleSet = eventDriver.createEventSet(text.toCharArray());   
      EventSet expectedSet = new EventSet();
      Vector<Event> tmp = new Vector<Event>();
      tmp.add(new Event("be", eventDriver));
      tmp.add(new Event("nimble,", eventDriver));
      tmp.add(new Event("be", eventDriver));
View Full Code Here

TOP

Related Classes of com.jgaap.generics.EventDriver

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.