在标准答案与分词结果上执行评测

@param goldFile
@param predFile
@return
165481
public static Result evaluate(String goldFile, String predFile) throws IOException
    {
        return evaluate(goldFile, predFile, null);
    }
63376
public JavaFileObject asJavaFileObject(File file) {
        JavacFileManager fm = (JavacFileManager)context.get(JavaFileManager.class);
        return fm.getRegularFile(file);
    }
293549
private Feature[] parseForFeature(String jsonFile) {
        try (Reader reader = new InputStreamReader(new FileInputStream(jsonFile), StandardCharsets.UTF_8)) {
            Feature[] features = mapper.readValue(reader, Feature[].class);
            if (ArrayUtils.isEmpty(features)) {
                LOG.log(Level.INFO, "File '{}' does not contain features", jsonFile);
            }
            return features;
        } catch (JsonMappingException e) {
            throw new ValidationException(String.format("File '%s' is not proper Cucumber report!", jsonFile), e);
        } catch (IOException e) {
            // IO problem - stop generating and re-throw the problem
            throw new ValidationException(e);
        }
    }
340671
private long getPreviousSegmentId(File file) {
        PbdSegmentName segmentName = PbdSegmentName.parseFile(m_usageSpecificLog, file);
        if (segmentName.m_result != PbdSegmentName.Result.OK) {
            throw new IllegalStateException("Invalid file name: " + file.getName());
        }
        return segmentName.m_prevId;
    }
705989
public boolean filterFile(File file)
    {
        String strName = file.getName();
        if (!strName.endsWith(".java"))
            return false;
        return super.filterFile(file);
    }
909711
private void doSendFile(final AsyncFile file, final OutputGroup group, final int position, final Handler<AsyncResult<Void>> doneHandler) {
    if (!group.sendQueueFull()) {
      file.read(new Buffer(BUFFER_SIZE), 0, position, BUFFER_SIZE, new Handler<AsyncResult<Buffer>>() {
        @Override
        public void handle(AsyncResult<Buffer> result) {
          if (result.failed()) {
            new DefaultFutureResult<Void>(result.cause()).setHandler(doneHandler);
          } else {
            Buffer buffer = result.result();
            if (buffer.length() > 0) {
              group.send(buffer);
              doSendFile(file, group, position+buffer.length(), doneHandler);
            } else {
              group.end();
              new DefaultFutureResult<Void>((Void) null).setHandler(doneHandler);
            }
          }
        }
      });
    } else {
      group.drainHandler(new Handler<Void>() {
        @Override
        public void handle(Void event) {
          doSendFile(file, group, position, doneHandler);
        }
      });
    }
  }
1058470
private void importSingleFile(String file, String toplevelCorpusName,
    long corpusRef)
  {

    BinaryImportHelper preStat = new BinaryImportHelper(file, getRealDataDir(),
      toplevelCorpusName,
      corpusRef, mimeTypeMapping);
    getJdbcTemplate().execute(BinaryImportHelper.SQL, preStat);

  }
600462
public static String[] splitFileNameIntoPreSuffix(String fileName) {
        String[] preSuffix = {fileName, EMPTY};
        int dotIndex = fileName.lastIndexOf(DOT);
        if (dotIndex > 0) {
            preSuffix[0] = fileName.substring(0, dotIndex);
            preSuffix[1] = fileName.substring(dotIndex);
        }
        return preSuffix;
    }
825486
public void load(File authorizationFile) throws AuthorizationFileException {
        FileInputStream fis = null;
        try {
            fis = new FileInputStream(authorizationFile);
            ANTLRInputStream stream = new ANTLRInputStream(fis);
            SAFPLexer lexer = new SAFPLexer(stream);
            CommonTokenStream tokens = new CommonTokenStream(lexer);
            SAFPParser parser = new SAFPParser(tokens);
            parser.prog();
            setAccessRules(parser.getAccessRules());
            setGroups(parser.getGroups());
            setAliases(parser.getAliases());
        } catch (FileNotFoundException e) {
            throw new AuthorizationFileException("FileNotFoundException: ", e);
        } catch (IOException e) {
            throw new AuthorizationFileException("IOException: ", e);
        } catch (RecognitionException e) {
            throw new AuthorizationFileException("Parser problem: ", e);
        } finally {
            try {
                fis.close();
            } catch (IOException e) {
                throw new AuthorizationFileException("IOExcetion during close: ", e);
            }
        }
    }
357801
def add(self, gold, pred):
        
        self.counter.update(zip(gold, pred))
1372851
private File createFileNameFromRequest(HttpServletRequest pRequest) {
        //System.out.println("ServletPath" + pRequest.getServletPath());
        String path = pRequest.getServletPath();

        // Find last '/'
        int splitIndex = path.lastIndexOf("/");

        // Split -> path + name
        String name = path.substring(splitIndex + 1);
        path = path.substring(0, splitIndex);

        // Replace special chars in name with '_'
        name = name.replace('.', '_');
        String param = parameterName.replace('.', '_');
        param = param.replace('/', '_');
        param = param.replace('\\', '_');
        param = param.replace(':', '_');

        // tempfile = realPath(path) + name + "_oparam_" + number + ".jsp"
        int count = getOparamCountFromRequest(pRequest);

        // Hmm.. Would be great, but seems like I can't serve pages from within the temp dir
        //File temp = (File) getServletContext().getAttribute("javax.servlet.context.tempdir");
        //return new File(new File(temp, path), name + "_oparam_" + count + "_" + param + ".jsp");

        return new File(new File(pageContext.getServletContext().getRealPath(path)), name + "_oparam_" + count + "_" + param + ".jsp");
    }
1092021
function (newData) {
            var result = new $.Deferred();
            var path = this.path;
            var prefFile = FileSystem.getFileForPath(path);

            if (path) {
                try {
                    var text = JSON.stringify(newData, null, 4);

                    // maintain the original line endings
                    text = FileUtils.translateLineEndings(text, this._lineEndings);
                    prefFile.write(text, {}, function (err) {
                        if (err) {
                            result.reject("Unable to save prefs at " + path + " " + err);
                        } else {
                            result.resolve();
                        }
                    });
                } catch (e) {
                    result.reject("Unable to convert prefs to JSON" + e.toString());
                }
            } else {
                result.resolve();
            }
            return result.promise();
        }
517997
public static FactorGraph getFgLat(FactorGraph fgLatPred, VarConfig goldConfig) {
        // TODO: instead, have this just look at whether or not the var is in the gold config
        List<Var> predictedVars = VarSet.getVarsOfType(fgLatPred.getVars(), VarType.PREDICTED);
        VarConfig predConfig = goldConfig.getIntersection(predictedVars);
        FactorGraph fgLat = fgLatPred.getClamped(predConfig);
        assert (fgLatPred.getNumFactors() <= fgLat.getNumFactors());
        return fgLat;
    }
96457
public static DownloadResponse exportSpreadsheet(Drive drive, File file) throws IOException {
    return exportSpreadsheet(drive, file.getId());
  }
687280
function getPublishFile(selectedFile) {
        console.log('你需要发布文件如下：');
        
        var files = [];
        selectedFile.forEach(function(file, idx) {
            console.log('  [' + (idx + 1) + ']' + file);
            files.push(file);
        });
        
        prepareBatchPubFiles(awpConfig, pubConfig, files);

    }
674230
public static function toFile(array $args, $link = null, $pre = null) {
		$list = array();
		if (is_array($args)) {
			foreach ($args as $key => $value) {
				if (is_int($key)) {
					if (is_array($value)) {
						$list = array_merge($list, self::toFile($value, $link, $pre));
					} elseif(is_object($value)) {
						$list[] = $value;
					} else {
						$list[] = $pre.$value;
					}
				} else {
					if (is_array($value)) {
						$list = array_merge($list, self::toFile($value, $link, $key.$link));
					} else {
						$list[] = $pre.$key.$link.$value;
					}
				}
			}
		} else {
			$list[] = $pre.$args;
		}
		return $list;
	}
415321
private static void addBundleFile(final Object bundlefile, final Set<Object> path,
            final ClassLoader classLoader, final ClasspathOrder classpathOrderOut, final ScanSpec scanSpec,
            final LogNode log) {
        // Don't get stuck in infinite loop
        if (bundlefile != null && path.add(bundlefile)) {
            // type File
            final Object basefile = ReflectionUtils.getFieldVal(bundlefile, "basefile", false);
            if (basefile != null) {
                boolean foundClassPathElement = false;
                for (final String fieldName : FIELD_NAMES) {
                    final Object fieldVal = ReflectionUtils.getFieldVal(bundlefile, fieldName, false);
                    foundClassPathElement = fieldVal != null;
                    if (foundClassPathElement) {
                        // We found the base file and a classpath element, e.g. "bin/"
                        classpathOrderOut.addClasspathEntry(basefile.toString() + "/" + fieldVal.toString(),
                                classLoader, scanSpec, log);
                        break;
                    }
                }

                if (!foundClassPathElement) {
                    // No classpath element found, just use basefile
                    classpathOrderOut.addClasspathEntry(basefile.toString(), classLoader, scanSpec, log);
                }

            }
            addBundleFile(ReflectionUtils.getFieldVal(bundlefile, "wrapped", false), path, classLoader,
                    classpathOrderOut, scanSpec, log);
            addBundleFile(ReflectionUtils.getFieldVal(bundlefile, "next", false), path, classLoader,
                    classpathOrderOut, scanSpec, log);
        }
    }