public LocalLink toLocalLink(Language language, int wpId) { return new LocalLink(language, anchortext, wpId, dest, true, startChar, true, LocalLink.LocationType.NONE); } }
public LocalLink getLocalOutLink(Language lang, int sourceId) { return new LocalLink(lang, null, sourceId, pageId, true, -1, null, null); }
public LocalLink getLocalInLink(Language lang, int destId) { return new LocalLink(lang, null, pageId, destId, false, -1, null, null); }
@Override public List<LocalLink> wikify(String text) throws DaoException { List<LinkInfo> candidates = getCandidates(text); List<LinkInfo> detected = detectLinks(candidates); List<LocalLink> results = new ArrayList<LocalLink>(); for (LinkInfo li : detected) { results.add(new LocalLink(language, li.getAnchortext(), -1, li.getDest(), true, li.getStartChar(), true, null)); } // Sort by position Collections.sort(results, new Comparator<LocalLink>() { @Override public int compare(LocalLink l1, LocalLink l2) { return l1.getLocation() - l2.getLocation(); } }); return results; }
@Override public List<LocalLink> wikify(int wpId, String text) throws DaoException { List<LinkInfo> candidates = getCandidates(text); identifyKnownCandidates(wpId, candidates); List<LinkInfo> detected = detectLinks(candidates); List<LocalLink> results = new ArrayList<LocalLink>(); for (LinkInfo li : detected) { results.add(new LocalLink(language, li.getAnchortext(), wpId, li.getDest(), true, li.getStartChar(), true, null)); } return results; }
LocalLink ll = new LocalLink(language, "", srcPageId, destId, true, -1, false, LocalLink.LocationType.NONE); if (!existing.contains(ll)) {
LocalLink ll = new LocalLink(language, "", srcPageId, destId, true, -1, false, LocalLink.LocationType.NONE); if (!existing.contains(ll)) {
private LocalLink cloneLinkWithLocation(LocalLink ll, int location) { return new LocalLink( ll.getLanguage(), ll.getAnchorText(), ll.getSourceId(), ll.getDestId(), ll.isOutlink(), location, ll.isParseable(), ll.getLocType() ); }
LocalLink ll = new LocalLink( lang, link.text,
private LocalLink buildLocalLink(Record record, boolean outlink){ if (record == null){ return null; } return new LocalLink( Language.getById(record.getValue(Tables.LOCAL_LINK.LANG_ID)), record.getValue(Tables.LOCAL_LINK.ANCHOR_TEXT), record.getValue(Tables.LOCAL_LINK.SOURCE_ID), record.getValue(Tables.LOCAL_LINK.DEST_ID), outlink, record.getValue(Tables.LOCAL_LINK.LOCATION), record.getValue(Tables.LOCAL_LINK.IS_PARSEABLE), LocalLink.LocationType.values()[record.getValue(Tables.LOCAL_LINK.LOCATION_TYPE)] ); }
int srcId = outlinks ? localId : lid.getId(); int destId = outlinks ? lid.getId() : localId; LocalLink ll = new LocalLink( lid.getLanguage(), null,