// Path: JHazm/src/main/java/jhazm/model/Document.java
// public class Document {
//     private String ID;
//     private String Number;
//     private String OriginalFile;
//     private String Issue;
//     private String WesternDate;
//     private String PersianDate;
//     private String EnglishCategory;
//     private String PersianCategory;
//     private String Title;
//     private String Body;
// 
//     public String getID() { return ID; }
// 
//     public void setID(String ID) { this.ID = ID; }
// 
//     public String getNumber() { return Number; }
// 
//     public void setNumber(String Number) { this.Number = Number; }
// 
//     public String getOriginalFile() { return OriginalFile; }
// 
//     public void setOriginalFile(String OriginalFile) { this.OriginalFile = OriginalFile; }
// 
//     public String getIssue() { return Issue; }
// 
//     public void setIssue(String Issue) { this.Issue = Issue; }
// 
//     public String getWesternDate() { return WesternDate; }
// 
//     public void setWesternDate(String WesternDate) { this.WesternDate = WesternDate; }
// 
//     public String getPersianDate() { return PersianDate; }
// 
//     public void setPersianDate(String PersianDate) { this.PersianDate = PersianDate; }
// 
//     public String getEnglishCategory() { return EnglishCategory; }
// 
//     public void setEnglishCategory(String EnglishCategory) { this.EnglishCategory = EnglishCategory; }
// 
//     public String getPersianCategory() { return PersianCategory; }
// 
//     public void setPersianCategory(String PersianCategory) { this.PersianCategory = PersianCategory; }
// 
//     public String getTitle() { return Title; }
// 
//     public void setTitle(String Title) { this.Title = Title; }
// 
//     public String getBody() { return Body; }
//     public void setBody(String Body) { this.Body = Body; }
//     
//     @Override
//     public String toString() {
//         return String.format("Document:\n\tID:\t%s\n\tNumber:\t%s\n\tOriginalFile:\t%s\n\tIssue:\t%s\n\tWesternDate:\t%s\n\tPersianDate:\t%s\n\tEnglishCategory:\t%s\n\tPersianCategory:\t%s\n\tTitle:\t%s\n\tBody:\t%s", 
//                 ID,
//                 Number,
//                 OriginalFile,
//                 Issue,
//                 WesternDate,
//                 PersianDate,
//                 EnglishCategory,
//                 PersianCategory,
//                 Title,
//                 Body);
//     }
// }
// 
// Path: JHazm/src/main/java/jhazm/utility/RegexPattern.java
// public class RegexPattern {
//     private final String Pattern;
//     private final String Replace;
//     public RegexPattern(String pattern, String replace) {
//         this.Pattern = pattern;
//         this.Replace = replace;
//     }
// 
//     public String apply(String text) {
//         return text.replaceAll(Pattern, Replace);
//     }
// }


import com.infomancers.collections.yield.Yielder;
import jhazm.model.Document;
import jhazm.utility.RegexPattern;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
                    DOCs = doc.getElementsByTagName("DOC");
                    docIndex = -1;
                    docLength = DOCs.getLength();
                }

                docIndex++;
                Element DOC = (Element)DOCs.item(docIndex);

                Element DOCID = (Element)DOC.getElementsByTagName("DOCID").item(0);
                Element DOCNO = (Element)DOC.getElementsByTagName("DOCNO").item(0);
                Element ORIGINALFILE = (Element)DOC.getElementsByTagName("ORIGINALFILE").item(0);
                Element ISSUE = (Element)DOC.getElementsByTagName("ISSUE").item(0);
                Element TITLE = (Element)DOC.getElementsByTagName("TITLE").item(0);
                
                NodeList DATEs = DOC.getElementsByTagName("DATE");
                String WesternDate = "";
                String PersianDate = "";
                for (int i = 0; i < DATEs.getLength(); i++) {
                    Element DATE = (Element)DATEs.item(i);
                    switch (DATE.getAttribute("calender")) {
                        case "Western":
                            WesternDate = DATE.getTextContent();
                            break;
                        case "Persian":
                            PersianDate = DATE.getTextContent();
                            break;
                    }
                }
                
                NodeList CATs = DOC.getElementsByTagName("CAT");
// Path: JHazm/src/main/java/jhazm/model/Document.java
// public class Document {
//     private String ID;
//     private String Number;
//     private String OriginalFile;
//     private String Issue;
//     private String WesternDate;
//     private String PersianDate;
//     private String EnglishCategory;
//     private String PersianCategory;
//     private String Title;
//     private String Body;
// 
//     public String getID() { return ID; }
// 
//     public void setID(String ID) { this.ID = ID; }
// 
//     public String getNumber() { return Number; }
// 
//     public void setNumber(String Number) { this.Number = Number; }
// 
//     public String getOriginalFile() { return OriginalFile; }
// 
//     public void setOriginalFile(String OriginalFile) { this.OriginalFile = OriginalFile; }
// 
//     public String getIssue() { return Issue; }
// 
//     public void setIssue(String Issue) { this.Issue = Issue; }
// 
//     public String getWesternDate() { return WesternDate; }
// 
//     public void setWesternDate(String WesternDate) { this.WesternDate = WesternDate; }
// 
//     public String getPersianDate() { return PersianDate; }
// 
//     public void setPersianDate(String PersianDate) { this.PersianDate = PersianDate; }
// 
//     public String getEnglishCategory() { return EnglishCategory; }
// 
//     public void setEnglishCategory(String EnglishCategory) { this.EnglishCategory = EnglishCategory; }
// 
//     public String getPersianCategory() { return PersianCategory; }
// 
//     public void setPersianCategory(String PersianCategory) { this.PersianCategory = PersianCategory; }
// 
//     public String getTitle() { return Title; }
// 
//     public void setTitle(String Title) { this.Title = Title; }
// 
//     public String getBody() { return Body; }
//     public void setBody(String Body) { this.Body = Body; }
//     
//     @Override
//     public String toString() {
//         return String.format("Document:\n\tID:\t%s\n\tNumber:\t%s\n\tOriginalFile:\t%s\n\tIssue:\t%s\n\tWesternDate:\t%s\n\tPersianDate:\t%s\n\tEnglishCategory:\t%s\n\tPersianCategory:\t%s\n\tTitle:\t%s\n\tBody:\t%s", 
//                 ID,
//                 Number,
//                 OriginalFile,
//                 Issue,
//                 WesternDate,
//                 PersianDate,
//                 EnglishCategory,
//                 PersianCategory,
//                 Title,
//                 Body);
//     }
// }
// 
// Path: JHazm/src/main/java/jhazm/utility/RegexPattern.java
// public class RegexPattern {
//     private final String Pattern;
//     private final String Replace;
//     public RegexPattern(String pattern, String replace) {
//         this.Pattern = pattern;
//         this.Replace = replace;
//     }
// 
//     public String apply(String text) {
//         return text.replaceAll(Pattern, Replace);
//     }
// }


// Path: JHazm/src/main/java/jhazm/reader/HamshahriReader.java
import com.infomancers.collections.yield.Yielder;
import jhazm.model.Document;
import jhazm.utility.RegexPattern;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

                    DOCs = doc.getElementsByTagName("DOC");
                    docIndex = -1;
                    docLength = DOCs.getLength();
                }

                docIndex++;
                Element DOC = (Element)DOCs.item(docIndex);

                Element DOCID = (Element)DOC.getElementsByTagName("DOCID").item(0);
                Element DOCNO = (Element)DOC.getElementsByTagName("DOCNO").item(0);
                Element ORIGINALFILE = (Element)DOC.getElementsByTagName("ORIGINALFILE").item(0);
                Element ISSUE = (Element)DOC.getElementsByTagName("ISSUE").item(0);
                Element TITLE = (Element)DOC.getElementsByTagName("TITLE").item(0);
                
                NodeList DATEs = DOC.getElementsByTagName("DATE");
                String WesternDate = "";
                String PersianDate = "";
                for (int i = 0; i < DATEs.getLength(); i++) {
                    Element DATE = (Element)DATEs.item(i);
                    switch (DATE.getAttribute("calender")) {
                        case "Western":
                            WesternDate = DATE.getTextContent();
                            break;
                        case "Persian":
                            PersianDate = DATE.getTextContent();
                            break;
                    }
                }
                
                NodeList CATs = DOC.getElementsByTagName("CAT");
                String EnglishCategory = "";