Search in sources :

Example 1 with ReconJudgeSimilarCellsOperation

use of com.google.refine.operations.recon.ReconJudgeSimilarCellsOperation in project OpenRefine by OpenRefine.

the class ReconJudgeSimilarCellsCommand method createOperation.

@Override
protected AbstractOperation createOperation(Project project, HttpServletRequest request, JSONObject engineConfig) throws Exception {
    String columnName = request.getParameter("columnName");
    String similarValue = request.getParameter("similarValue");
    Judgment judgment = Recon.stringToJudgment(request.getParameter("judgment"));
    ReconCandidate match = null;
    String id = request.getParameter("id");
    if (id != null) {
        String scoreString = request.getParameter("score");
        match = new ReconCandidate(id, request.getParameter("name"), request.getParameter("types").split(","), scoreString != null ? Double.parseDouble(scoreString) : 100);
    }
    String shareNewTopics = request.getParameter("shareNewTopics");
    return new ReconJudgeSimilarCellsOperation(engineConfig, columnName, similarValue, judgment, match, "true".equals(shareNewTopics));
}
Also used : ReconJudgeSimilarCellsOperation(com.google.refine.operations.recon.ReconJudgeSimilarCellsOperation) ReconCandidate(com.google.refine.model.ReconCandidate) Judgment(com.google.refine.model.Recon.Judgment)

Aggregations

Judgment (com.google.refine.model.Recon.Judgment)1 ReconCandidate (com.google.refine.model.ReconCandidate)1 ReconJudgeSimilarCellsOperation (com.google.refine.operations.recon.ReconJudgeSimilarCellsOperation)1