Package com.google.refine.model

Examples of com.google.refine.model.Recon


                                result.getString("name"),
                                typeIDs,
                                100
                        );

                        Recon recon = Recon.makeFreebaseRecon(historyEntryID);
                        recon.addCandidate(candidate);
                        recon.service = "mql";
                        recon.judgment = Judgment.Matched;
                        recon.judgmentAction = "auto";
                        recon.match = candidate;
                        recon.matchRank = 0;

                        guidToRecon.put(guid, recon);
                    }
                }
            } finally {
                is.close();
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
       
        for (ReconJob job : jobs) {
            String guid = ((GuidBasedReconJob) job).guid;
            Recon recon = guidToRecon.get(guid);
            if (recon == null) {
                recon = createNoMatchRecon(historyEntryID);
            }
            recons.add(recon);
        }
View Full Code Here


            if (cell != null) {
                String link = null;
                String text = null;
               
                if (cell.recon != null) {
                    Recon recon = cell.recon;
                    if (recon.judgment == Recon.Judgment.Matched) {
                        if (recon_outputMode == ReconOutputMode.ENTITY_NAME) {
                            text = recon.match.name;
                        } else if (recon_outputMode == ReconOutputMode.ENTITY_ID) {
                            text = recon.match.id;
View Full Code Here

            public boolean visit(Project project, int rowIndex, Row row) {
                Cell cell = row.getCell(cellIndex);
                if (cell != null) {
                    long reconID = cell.recon != null ? cell.recon.id : 0;
                   
                    Recon newRecon;
                    if (dupReconMap.containsKey(reconID)) {
                        newRecon = dupReconMap.get(reconID);
                        newRecon.judgmentBatchSize++;
                    } else {
                        newRecon = cell.recon != null ?
                            cell.recon.dup(historyEntryID) :
                            new Recon(
                                historyEntryID,
                                identifierSpace,
                                schemaSpace);
                           
                        newRecon.match = match;
View Full Code Here

                if (cell != null && ExpressionUtils.isNonBlankData(cell.value)) {
                    String value = cell.value instanceof String ?
                            ((String) cell.value) : cell.value.toString();
                           
                    if (_similarValue.equals(value)) {
                        Recon recon = null;
                        if (_judgment == Judgment.New && _shareNewTopics) {
                            if (_sharedNewRecon == null) {
                                _sharedNewRecon = new Recon(_historyEntryID, null, null);
                                _sharedNewRecon.judgment = Judgment.New;
                                _sharedNewRecon.judgmentBatchSize = 0;
                                _sharedNewRecon.judgmentAction = "similar";
                            }
                            _sharedNewRecon.judgmentBatchSize++;
View Full Code Here

                }
               
                List<Recon> recons = _reconConfig.batchRecon(jobs, _historyEntryID);
                for (int j = jobs.size() - 1; j >= 0; j--) {
                    ReconJob job = jobs.get(j);
                    Recon    recon = j < recons.size() ? recons.get(j) : null;
                    JobGroup group = jobToGroup.get(job);
                    List<ReconEntry> entries = group.entries;
                   
                    if (recon == null) {
                        group.trials++;
View Full Code Here

           
            @Override
            public boolean visit(Project project, int rowIndex, Row row) {
                Cell cell = row.getCell(cellIndex);
                if (cell != null && cell.recon != null) {
                    Recon newRecon = null;
                    if (!_clearData) {
                        if (dupReconMap.containsKey(cell.recon.id)) {
                            newRecon = dupReconMap.get(cell.recon.id);
                            newRecon.judgmentBatchSize++;
                        } else {
View Full Code Here

           
            @Override
            public boolean visit(Project project, int rowIndex, Row row) {
                Cell cell = row.getCell(cellIndex);
                if (cell != null) {
                    Recon recon = null;
                    if (_shareNewTopics) {
                        String s = cell.value == null ? "" : cell.value.toString();
                        if (sharedRecons.containsKey(s)) {
                            recon = sharedRecons.get(s);
                            recon.judgmentBatchSize++;
                        } else {
                            recon = new Recon(historyEntryID, null, null);
                            recon.judgment = Judgment.New;
                            recon.judgmentBatchSize = 1;
                            recon.judgmentAction = "mass";
                           
                            sharedRecons.put(s, recon);
                        }
                    } else {
                        recon = cell.recon == null ? new Recon(historyEntryID, null, null) : cell.recon.dup(historyEntryID);
                        recon.match = null;
                        recon.matchRank = -1;
                        recon.judgment = Judgment.New;
                        recon.judgmentBatchSize = 1;
                        recon.judgmentAction = "mass";
View Full Code Here

   
    static protected Cell extractCell(org.apache.poi.ss.usermodel.Cell cell, Map<String, Recon> reconMap) {
        Serializable value = extractCell(cell);
       
        if (value != null) {
            Recon recon = null;
           
            Hyperlink hyperlink = cell.getHyperlink();
            if (hyperlink != null) {
                String url = hyperlink.getAddress();
               
                if (url != null && (url.startsWith("http://") ||
                    url.startsWith("https://"))) {
                   
                    final String sig = "freebase.com/view";
                   
                    int i = url.indexOf(sig);
                    if (i > 0) {
                        String id = url.substring(i + sig.length());
                       
                        int q = id.indexOf('?');
                        if (q > 0) {
                            id = id.substring(0, q);
                        }
                        int h = id.indexOf('#');
                        if (h > 0) {
                            id = id.substring(0, h);
                        }
                       
                        if (reconMap.containsKey(id)) {
                            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);
                           
                            reconMap.put(id, recon);
                        }
                       
                    }
View Full Code Here

                Row row = project.rows.get(r);
               
                for (int c = 0; c < row.cells.size(); c++) {
                    Cell cell = row.cells.get(c);
                    if (cell != null && cell.recon != null) {
                        Recon recon = cell.recon;
                       
                        if (reconMap.containsKey(recon.id)) {
                            row.setCell(c, new Cell(cell.value, reconMap.get(recon.id)));
                        }
                    }
View Full Code Here

    static protected void loadRecons(LineNumberReader reader, Pool pool, Map<Long, Recon> recons, String countString) throws Exception {
        int count = Integer.parseInt(countString);
       
        for (int i = 0; i < count; i++) {
            String line = reader.readLine();
            Recon recon = Recon.loadStreaming(line, pool);
           
            recons.put(recon.id, recon);
        }
    }
View Full Code Here

TOP

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

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.