code: public static Map<String, String[]> loadCorpusWithException(String folderPath, String charsetName) throws IOException
      {
          if (folderPath == null) throw new IllegalArgumentException("参数 folderPath == null");
          File root = new File(folderPath);
          if (!root.exists()) throw new IllegalArgumentException(String.format("目录 %s 不存在", root.getAbsolutePath()));
          if (!root.isDirectory())
              throw new IllegalArgumentException(String.format("目录 %s 不是一个目录", root.getAbsolutePath()));
  
          Map<String, String[]> dataSet = new TreeMap<String, String[]>();
          File[] folders = root.listFiles();
          if (folders == null) return null;
          for (File folder : folders)
          {
              if (folder.isFile()) continue;
              File[] files = folder.listFiles();
              if (files == null) continue;
              String[] documents = new String[files.length];
              for (int i = 0; i < files.length; i++)
              {
                  documents[i] = readTxt(files[i], charsetName);
              }
              dataSet.put(folder.getName(), documents);
          }
  
          return dataSet;
      }
docs: 加载一个文件夹下的所有语料
  
  @param folderPath
  @return