Examples of HostReference


Examples of de.anomic.yacy.graphics.WebStructureGraph.HostReference

            int count = 0;
            for (ReferenceContainer<HostReference> references: idx) {
                prop.put("list_" + count + "_term", ASCII.String(references.getTermHash()));
                Iterator<HostReference> referenceIterator = references.entries();
                StringBuilder s = new StringBuilder();
                HostReference reference;
                while (referenceIterator.hasNext()) {
                    reference = referenceIterator.next();
                    s.append(reference.toPropertyForm());
                    if (referenceIterator.hasNext()) s.append(",");
                }
                prop.put("list_" + count + "_references", s.toString());
                prop.put("list_" + count + "_comma", 1);
                count++;
View Full Code Here

Examples of de.anomic.yacy.graphics.WebStructureGraph.HostReference

                String reference;
                final ReferenceContainer<HostReference> referenceContainer = new ReferenceContainer<HostReference>(WebStructureGraph.hostReferenceFactory, UTF8.getBytes(term));
                try {
                    while ((reference = references.getString(c++)) != null) {
                        //System.out.println("REFERENCE: " + reference);
                        referenceContainer.add(new HostReference(reference));
                    }
                } catch (final JSONException e) {} // this finishes the iteration
                index.add(referenceContainer);
            }
            return index;
View Full Code Here

Examples of de.anomic.yacy.graphics.WebStructureGraph.HostReference

                hostCount = hostStat == null ? 6 /* high = a penalty for 'i do not know this', this may not be fair*/ : Math.max(1, hostStat.count);
                hostScore.set(container.getTermHash(), container.size() * maxHostCount / hostCount);
            } else {
                int score = 0;
                Iterator<HostReference> hri = container.entries();
                HostReference hr;
                while (hri.hasNext()) {
                    hr = hri.next();
                    hostStat =  hostHashResolver.get(ASCII.String(hr.urlhash()));
                    hostCount = hostStat == null ? 6 /* high = a penalty for 'i do not know this', this may not be fair*/ : Math.max(1, hostStat.count);
                    score += (17 - ranking(hr.urlhash(), referenceTable)) * maxHostCount / hostCount;
                }
                hostScore.set(container.getTermHash(), score);
            }
        }
       
View Full Code Here

Examples of net.yacy.peers.graphics.WebStructureGraph.HostReference

            int count = 0;
            for (final ReferenceContainer<HostReference> references: idx) {
                prop.put("list_" + count + "_term", ASCII.String(references.getTermHash()));
                final Iterator<HostReference> referenceIterator = references.entries();
                final StringBuilder s = new StringBuilder(references.size() * 20); // pre-set of guessed size reduces expandCapacity() and increases performance
                HostReference reference;
                while (referenceIterator.hasNext()) {
                    reference = referenceIterator.next();
                    s.append(reference.toPropertyForm());
                    if (referenceIterator.hasNext()) s.append(",");
                }
                prop.put("list_" + count + "_references", s.toString());
                prop.put("list_" + count + "_comma", 1);
                count++;
View Full Code Here

Examples of net.yacy.peers.graphics.WebStructureGraph.HostReference

                hostCount = hostStat == null ? 6 /* high = a penalty for 'i do not know this', this may not be fair*/ : Math.max(1, hostStat.count);
                hostScore.set(container.getTermHash(), container.size() * maxHostCount / hostCount);
            } else {
                int score = 0;
                final Iterator<HostReference> hri = container.entries();
                HostReference hr;
                while (hri.hasNext()) {
                    hr = hri.next();
                    hostStat =  hostHashResolver.get(ASCII.String(hr.urlhash()));
                    hostCount = hostStat == null ? 6 /* high = a penalty for 'i do not know this', this may not be fair*/ : Math.max(1, hostStat.count);
                    score += (17 - ranking(hr.urlhash(), referenceTable)) * maxHostCount / hostCount;
                }
                hostScore.set(container.getTermHash(), score);
            }
        }

View Full Code Here

Examples of net.yacy.peers.graphics.WebStructureGraph.HostReference

                String reference;
                final ReferenceContainer<HostReference> referenceContainer = new ReferenceContainer<HostReference>(WebStructureGraph.hostReferenceFactory, UTF8.getBytes(term));
                try {
                    while ((reference = references.getString(c++)) != null) {
                        //System.out.println("REFERENCE: " + reference);
                        referenceContainer.add(new HostReference(reference));
                    }
                } catch (final JSONException e) {} // this finishes the iteration
                index.add(referenceContainer);
            }
            return index;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.