public int readAllFilesInResource(int maxLinePerFile, String folderStr, boolean isDebugging) {
        URL folderURL = LoadSourceToTrainData.class.getResource(folderStr);
        String folderPath = folderURL.getPath();
        File folder = new File(folderPath);
        File[] listOfFiles = folder.listFiles();
        System.out.println("Num of train data files = " + listOfFiles.length);
        int totalAnnotatedSentences = 0;
        LoadSourceToTrainData.maxLines = maxLinePerFile;

        for (int i = 0; i < listOfFiles.length; i++) {
        //for (int i = 0; i < 1; i++) {
            File file = listOfFiles[i];
            if (file.isFile() && file.getName().endsWith(".txt")) {
                System.out.println("Loading data from file: " + file.getName());

                try {
                    List<String> contents = FileUtils.readLines(file, Charsets.UTF_8);
                    int outputLineCount = 0;
                    for (String aLine : contents) {
                        Pattern p = Pattern.compile(".*\\[([+-]\\d+)\\].*##\\W*(.*)");
                        Matcher m = p.matcher(aLine);
                        if (!aLine.isEmpty() && m.matches()) {
                            if (outputLineCount < LoadSourceToTrainData.maxLines) {
                                System.out.println("Original:   " + aLine);
                                System.out.println("Extracted:   Score: " + m.group(1) + "  ==> " + m.group(2));
                                if (Integer.parseInt(m.group(1)) > 0) {  // A positive review
                                    parserToDependTreeList.add(new ParserToDependTree(m.group(2), true, isDebugging));
                                } else {
                                    parserToDependTreeList.add(new ParserToDependTree(m.group(2), false, isDebugging));
                                }
                                totalAnnotatedSentences++;
                                outputLineCount++;
                            }
                        }
                    }
                } catch (IOException e) {
                    e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                }
            }
            System.out.println("TotalAnnotatedSentenced = " + totalAnnotatedSentences + "\n");
        }

        return totalAnnotatedSentences;
    }