(domain-ranking) Fix a crash during ranking the edges of the similarity graph doesn't quite match the vertices of the link graph.

This commit is contained in:
Viktor Lofgren 2024-02-25 12:14:51 +01:00
parent 7fc0d4d786
commit 823ca73a3f

View File

@ -52,6 +52,14 @@ public class SimilarityGraphSource extends AbstractGraphSource {
while (rs.next()) {
int src = rs.getInt(1);
int dest = rs.getInt(2);
// Similarity data may contain domain ids that we don't have indexed,
// omit these from the graph.
if (!graph.containsVertex(src))
continue;
if (!graph.containsVertex(dest))
continue;
double weight = rs.getDouble(3);
graph.addEdge(src, dest);