Package com.music.service.text

Examples of com.music.service.text.SentimentAnalyzer


public class SentimentAnalyzerTest {

    @Test
    public void testSentimentAnalyzer() {
        SentimentAnalyzer analyzer = new SentimentAnalyzer();
        analyzer.init();

        TimelineMusic meta = new TimelineMusic();
        SentimentResult result = analyzer.getSentiment(Sets.newHashSet("This sucks", "Too bad it didn't happen", "Not cool, man"), meta);
        assertEquals(SentimentResult.NEGATIVE, result);

        result = analyzer.getSentiment(Sets.newHashSet("Whatever", "I'm coming tomorrow by bus", "Three cities participated in the campagin"), meta);
        assertEquals(SentimentResult.NEUTRAL, result);

        result = analyzer.getSentiment(Sets.newHashSet("Brilliant job", "Nice one, mate", "I really appreciate your effort"), meta);
        assertEquals(SentimentResult.POSITIVE, result);
    }
View Full Code Here

TOP

Related Classes of com.music.service.text.SentimentAnalyzer

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.