Package de.julielab.genemapper
Class WikipediaCategoryManager
- java.lang.Object
-
- de.julielab.genemapper.WikipediaCategoryManager
-
public class WikipediaCategoryManager extends Object
-
-
Constructor Summary
Constructors Constructor Description WikipediaCategoryManager(String pathname, boolean reverse)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbuildDijkstraTree(String root)List<String>getCategoriesForCategory(String categoryName)List<String>getCategoriesForPage(String pageTitle)List<String>getShortestPath(String title, String category)A little Dijkstra to find the shortest path of categories from a Wikipedia page to the given category.List<String>getShortestPathToDijkstraTreeRoot(String title, Set<String> prohibitedPathElements)static voidmain(String[] args)
-
-
-
Constructor Detail
-
WikipediaCategoryManager
public WikipediaCategoryManager(String pathname, boolean reverse)
-
-
Method Detail
-
main
public static void main(String[] args) throws IOException, GeneMapperException
- Throws:
IOExceptionGeneMapperException
-
getShortestPathToDijkstraTreeRoot
public List<String> getShortestPathToDijkstraTreeRoot(String title, Set<String> prohibitedPathElements)
-
buildDijkstraTree
public void buildDijkstraTree(String root)
-
getShortestPath
public List<String> getShortestPath(String title, String category)
A little Dijkstra to find the shortest path of categories from a Wikipedia page to the given category.- Parameters:
title- A Wikipedia page title or a category (categories must have the 'Category:' prefix).category- The category to find a path to.- Returns:
- The shortest path from the title to the category.
-
-