Advertisement
Guest User

Untitled

a guest
Dec 17th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.77 KB | None | 0 0
  1. public void getMostFrequentWords() throws UnsupportedEncodingException {
  2.         String stopwords = "this\nbla";
  3.         String reviews = "1 bad movie\n2 average movie\n3 average performance\n2 bad";
  4.         InputStream stopwordsStream = new ByteArrayInputStream(stopwords.getBytes("UTF-8"));
  5.         InputStream reviewsStream = new ByteArrayInputStream(reviews.getBytes("UTF-8"));
  6.         OutputStream output = new ByteArrayOutputStream();
  7.         MovieReviewSentimentAnalyzer ma = new MovieReviewSentimentAnalyzer(stopwordsStream, reviewsStream, output);
  8.         ArrayList<String> wordsSorted = new ArrayList<>();
  9.         wordsSorted.add("average");
  10.         Collection<String> res = ma.getMostFrequentWords(1);
  11.         assertEquals(wordsSorted, ma.getMostFrequentWords(1));
  12.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement