Class WikipediaCategoryManager


  • public class WikipediaCategoryManager
    extends Object
    • Constructor Detail

      • WikipediaCategoryManager

        public WikipediaCategoryManager​(String pathname,
                                        boolean reverse)
    • Method Detail

      • getShortestPathToDijkstraTreeRoot

        public List<String> getShortestPathToDijkstraTreeRoot​(String title,
                                                              Set<String> prohibitedPathElements)
      • buildDijkstraTree

        public void buildDijkstraTree​(String root)
      • getCategoriesForPage

        public List<String> getCategoriesForPage​(String pageTitle)
      • getCategoriesForCategory

        public List<String> getCategoriesForCategory​(String categoryName)
      • 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.