Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void getMostFrequentWords() throws UnsupportedEncodingException {
- String stopwords = "this\nbla";
- String reviews = "1 bad movie\n2 average movie\n3 average performance\n2 bad";
- InputStream stopwordsStream = new ByteArrayInputStream(stopwords.getBytes("UTF-8"));
- InputStream reviewsStream = new ByteArrayInputStream(reviews.getBytes("UTF-8"));
- OutputStream output = new ByteArrayOutputStream();
- MovieReviewSentimentAnalyzer ma = new MovieReviewSentimentAnalyzer(stopwordsStream, reviewsStream, output);
- ArrayList<String> wordsSorted = new ArrayList<>();
- wordsSorted.add("average");
- Collection<String> res = ma.getMostFrequentWords(1);
- assertEquals(wordsSorted, ma.getMostFrequentWords(1));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement