package bullshit_paper;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

public class ArticleMixer {
    private class GraphElement {
        String word;
    }
    
    public List<IArticle> Mix(List<IArticle> articles) {
        /*
        for(IArticle article : articles) {
            String content = article.getContent();
            String[] words = content.split("[\\W]");
            Set<GraphElement> graph = new TreeSet<>();
            for(String word : words) {
                
                if( !graph.contains(word) ) {
                    graph.add(new GraphElement());
                }
            }
        }
         * 
         */
        List<IArticle> newArticles = new LinkedList<>();
        for(IArticle article : articles) {
            String content = article.getContent();
            String[] sentences = content.split("[.]");
            java.util.Collections.shuffle(Arrays.asList(sentences));
            StringBuilder newContent = new StringBuilder();
            for(String s : sentences) {
                newContent.append(s).append(".");
            }
            newArticles.add(new Article(article.getTitle(), newContent.toString(), article.getDate(), article.getComments(), article.getImages()));
        }
        return newArticles;
    }
}

@@ -35,21 +35,26 @@
 va.util.
-Array
+Collection
 s;%0Aimpor
@@ -104,638 +104,94 @@
 st;%0A
-import java.util.Set;%0Aimport java.util.TreeSet;%0A%0Apublic class ArticleMixer %7B%0A    private class GraphElement %7B%0A        String word;%0A    %7D%0A    %0A    public List%3CIArticle%3E Mix(List%3CIArticle%3E articles) %7B%0A        /*%0A        for(IArticle article : articles) %7B%0A            String content = article.getContent();%0A            String%5B%5D words = content.split(%22%5B%5C%5CW%5D%22);%0A            Set%3CGraphElement%3E graph = new TreeSet%3C%3E();%0A            for(String word : words) %7B%0A                %0A                if( !graph.contains(word) ) %7B%0A                    graph.add(new GraphElement());%0A                %7D%0A            %7D%0A        %7D%0A         * %0A         */
+%0Apublic class ArticleMixer %7B%0A%0A    public List%3CIArticle%3E Mix(List%3CIArticle%3E articles) %7B
 %0A   
@@ -255,16 +255,17 @@
      for
+ 
 (IArticl
@@ -355,16 +355,20 @@
     
+List%3C
 String
-%5B%5D
+%3E
  sen
@@ -380,27 +380,32 @@
 s = 
-content.split(%22%5B.%5D%22
+Parser.parseText(content
 );%0A 
@@ -415,26 +415,16 @@
         
-java.util.
 Collecti
@@ -439,22 +439,8 @@
 fle(
-Arrays.asList(
 sent
@@ -445,17 +445,16 @@
 ntences)
-)
 ;%0A      
@@ -522,16 +522,17 @@
      for
+ 
 (String 
@@ -588,20 +588,8 @@
 d(s)
-.append(%22.%22)
 ;%0A  

Implement basic ArticleMixer using Parser class