1d34224416
Look, this will make the git history look funny, but trimming unnecessary depth from the source tree is a very necessary sanity-preserving measure when dealing with a super-modularized codebase like this one. While it makes the project configuration a bit less conventional, it will save you several clicks every time you jump between modules. Which you'll do a lot, because it's *modul*ar. The src/main/java convention makes a lot of sense for a non-modular project though. This ain't that.
78 lines
2.4 KiB
Java
78 lines
2.4 KiB
Java
package nu.marginalia.ranking.domains;
|
|
|
|
import nu.marginalia.ranking.domains.accumulator.RankingResultListAccumulator;
|
|
import org.junit.jupiter.api.Disabled;
|
|
import org.junit.jupiter.api.Test;
|
|
|
|
import java.util.List;
|
|
|
|
// Test the ranking algorithm with prod data. Will not run if the data is not available.
|
|
// It's not feasible to include the data in the git repo, as it's ~6 GB of data.
|
|
@Disabled
|
|
class RankingAlgorithmWithRealDataTest {
|
|
|
|
@Test
|
|
public void testRegularPR() {
|
|
if (!TestGraphSourceForLinkData.isAvailable()) {
|
|
return;
|
|
}
|
|
|
|
var graphSource = new TestGraphSourceForLinkData();
|
|
var results = new PageRankDomainRanker(graphSource, List.of())
|
|
.calculate(10, RankingResultListAccumulator::new);
|
|
|
|
for (int i = 0; i < results.size(); i++) {
|
|
System.out.println(i + " " + graphSource.getName(results.get(i)));
|
|
}
|
|
}
|
|
|
|
@Test
|
|
public void testInvertedLinkGraph() {
|
|
if (!TestGraphSourceForInvertedLinkData.isAvailable()) {
|
|
return;
|
|
}
|
|
|
|
var graphSource = new TestGraphSourceForInvertedLinkData();
|
|
var results = new PageRankDomainRanker(graphSource, List.of())
|
|
.calculate(10, RankingResultListAccumulator::new);
|
|
|
|
for (int i = 0; i < results.size(); i++) {
|
|
System.out.println(i + " " + graphSource.getName(results.get(i)));
|
|
}
|
|
}
|
|
|
|
@Test
|
|
public void testSimilarityPR() {
|
|
if (!TestGraphSourceForSimilarityData.isAvailable()) {
|
|
return;
|
|
}
|
|
|
|
var graphSource = new TestGraphSourceForSimilarityData();
|
|
var results = new PageRankDomainRanker(graphSource, List.of())
|
|
.calculate(10, RankingResultListAccumulator::new);
|
|
|
|
for (int i = 0; i < results.size(); i++) {
|
|
System.out.println(i + " " + graphSource.getName(results.get(i)));
|
|
}
|
|
}
|
|
|
|
@Test
|
|
public void testSimilarityPPR() {
|
|
if (!TestGraphSourceForSimilarityData.isAvailable()) {
|
|
return;
|
|
}
|
|
|
|
var graphSource = new TestGraphSourceForSimilarityData();
|
|
var results = new PageRankDomainRanker(graphSource,
|
|
List.of(1476552) // wiby.me
|
|
)
|
|
.calculate(10, RankingResultListAccumulator::new);
|
|
|
|
for (int i = 0; i < results.size(); i++) {
|
|
System.out.println(i + " " + graphSource.getName(results.get(i)));
|
|
}
|
|
}
|
|
|
|
|
|
|
|
} |