code: public static CWSEvaluator.Result evaluate(Segment segment, String outputPath, String goldFile, String dictPath) throws IOException
      {
          IOUtil.LineIterator lineIterator = new IOUtil.LineIterator(goldFile);
          BufferedWriter bw = IOUtil.newBufferedWriter(outputPath);
          for (String line : lineIterator)
          {
              List<Term> termList = segment.seg(line.replaceAll("\\s+", "")); // 一些testFile与goldFile根本不匹配，比如MSR的testFile有些行缺少单词，所以用goldFile去掉空格代替
              int i = 0;
              for (Term term : termList)
              {
                  bw.write(term.word);
                  if (++i != termList.size())
                      bw.write("  ");
              }
              bw.newLine();
          }
          bw.close();
          CWSEvaluator.Result result = CWSEvaluator.evaluate(goldFile, outputPath, dictPath);
          return result;
      }
docs: 标准化评测分词器
  
  @param segment    分词器
  @param outputPath 分词预测输出文件
  @param goldFile   测试集segmented file
  @param dictPath   训练集单词列表
  @return 一个储存准确率的结构
  @throws IOException