Package com.google.refine.model

Examples of com.google.refine.model.ReconCandidate


       
        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
            );
View Full Code Here


            int rowIndex = Integer.parseInt(request.getParameter("row"));
            int cellIndex = Integer.parseInt(request.getParameter("cell"));
            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
                );
View Full Code Here

                    typeIDs[j] = type instanceof String ? (String) type :
                        ((JSONObject) type).getString("id");
                }
               
                double score = result.getDouble("score");
                ReconCandidate candidate = new ReconCandidate(
                    result.getString("id"),
                    result.getString("name"),
                    typeIDs,
                    score
                );
               
                if (autoMatch && i == 0 && result.has("match") && result.getBoolean("match")) {
                    recon.match = candidate;
                    recon.matchRank = 0;
                    recon.judgment = Judgment.Matched;
                    recon.judgmentAction = "auto";
                }
               
                recon.addCandidate(candidate);
                count++;
            }
           
            if (count > 0) {
                ReconCandidate candidate = recon.candidates.get(0);
               
                recon.setFeature(Recon.Feature_nameMatch, text.equalsIgnoreCase(candidate.name));
                recon.setFeature(Recon.Feature_nameLevenshtein,
                        StringUtils.getLevenshteinDistance(StringUtils.lowerCase(text), StringUtils.lowerCase(candidate.name)));
                recon.setFeature(Recon.Feature_nameWordDistance, wordDistance(text, candidate.name));
View Full Code Here

                            recon = reconMap.get(id);
                            recon.judgmentBatchSize++;
                        } else {
                            recon = new Recon(0, null, null);
                            recon.service = "import";
                            recon.match = new ReconCandidate(id, value.toString(), new String[0], 100);
                            recon.matchRank = 0;
                            recon.judgment = Judgment.Matched;
                            recon.judgmentAction = "auto";
                            recon.judgmentBatchSize = 1;
                            recon.addCandidate(recon.match);
View Full Code Here

                        String[] typeIDs = new String[types.length()];
                        for (int j = 0; j < typeIDs.length; j++) {
                            typeIDs[j] = types.getString(j);
                        }

                        ReconCandidate candidate = new ReconCandidate(
                                id,
                                result.getString("name"),
                                typeIDs,
                                100
                        );
View Full Code Here

        int col,
        JSONObject obj,
        Map<String, ReconCandidate> reconCandidateMap
    ) throws JSONException {
        String id = obj.getString("id");
        ReconCandidate rc;
        if (reconCandidateMap.containsKey(id)) {
            rc = reconCandidateMap.get(id);
        } else {
            rc = new ReconCandidate(
                    obj.getString("id"),
                    obj.getString("name"),
                    JSONUtilities.getStringArray(obj, "type"),
                    100
                );
View Full Code Here

                        String[] typeIDs = new String[types.length()];
                        for (int j = 0; j < typeIDs.length; j++) {
                            typeIDs[j] = types.getString(j);
                        }

                        ReconCandidate candidate = new ReconCandidate(
                                result.getString("id"),
                                result.getString("name"),
                                typeIDs,
                                100
                        );
View Full Code Here

    @Override
    protected AbstractOperation createOperation(Project project,
            HttpServletRequest request, JSONObject engineConfig) throws Exception {
       
        String columnName = request.getParameter("columnName");
        ReconCandidate match = new ReconCandidate(
            request.getParameter("topicID"),
            request.getParameter("topicName"),
            request.getParameter("types").split(","),
            100
        );
View Full Code Here

                                    writer.value(null);
                                }
                               
                                for (Object cell : row) {
                                    if (cell != null && cell instanceof ReconCandidate) {
                                        ReconCandidate rc = (ReconCandidate) cell;
                                        writer.object();
                                        writer.key("id"); writer.value(rc.id);
                                        writer.key("name"); writer.value(rc.name);
                                        writer.endObject();
                                    } else {
View Full Code Here

        for (int c = 0; c < values.length; c++) {
            Object value = values[c];
            Cell cell = null;
           
            if (value instanceof ReconCandidate) {
                ReconCandidate rc = (ReconCandidate) value;
                Recon recon;
                if (reconMap.containsKey(rc.id)) {
                    recon = reconMap.get(rc.id);
                } else {
                    recon = Recon.makeFreebaseRecon(_historyEntryID);
View Full Code Here

TOP

Related Classes of com.google.refine.model.ReconCandidate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.