Package edu.eltech.classifier

Examples of edu.eltech.classifier.Letter


    private List<Letter> nonSpamSamples = new ArrayList<Letter>();
    private PlainSpamClassifier classifier = new PlainSpamClassifier();

    @Before
    public void setUp() throws Exception {
        spamSamples.add(new Letter("title1", "THIS LETTER IS SENT TO YOU BECAUSE..."));
        spamSamples.add(new Letter("title2", "you won 100000000000000000$"));
        spamSamples.add(new Letter("title3", "spam SPAM SPAM spam"));
        spamSamples.add(new Letter("title4", "you won !!!!!!!!!!!!!!!!!!!!!"));

        nonSpamSamples.add(new Letter("title5", "THIS IS not an undesired subscription") );
        nonSpamSamples.add(new Letter("title6", "i am sending you 3000$") );
        nonSpamSamples.add(new Letter("title7", "Just a plain letter with some text") );
        nonSpamSamples.add(new Letter("title8", "The concert was excellent !!!") );
    }
View Full Code Here


    public void reduce(IntWritable key, Iterator<Letter> values,
                       OutputCollector<Category, Letter> collector, Reporter reporter) throws IOException {

          while (values.hasNext()) {
             
              Letter letter = values.next();
              /* classify the data */
              /* write data to the output */
              collector.collect(classifier.classify(letter), letter);
          }

View Full Code Here

            String letterText = csvReader.get(2);

            int outputKey = (id % 2 == 0) ? 1 : 2;

            /* 2. pass the results to the collector: the key-value pair */
            collector.collect( new IntWritable(outputKey), new Letter(name, letterText));
        }

    }
View Full Code Here

TOP

Related Classes of edu.eltech.classifier.Letter

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.