public class GroupOfCategories
extends java.lang.Object
A GroupOfCategories
instance contains the scored categories from
Wikipedia which are related to other called root category. This class
doesn't implement any rule to determine if a category must be included in
the group or not.
A scored category is a Wikipedia category which has been checked if it belongs to a certain domain.
de.tudarmstadt.ukp.wikipedia.api.Category
,
GroupOfCategories.ScoredCategory
Modifier and Type | Class and Description |
---|---|
static class |
GroupOfCategories.ScoredCategory
The
ScoredCategory class enriches the
de.tudarmstadt.ukp.wikipedia.api.Category objects providing the
following information:
Parent: The first category which allows access to this one. |
Constructor and Description |
---|
GroupOfCategories(Category root)
Creates an empty group of categories related to the given root category.
|
GroupOfCategories(java.io.File input,
WikipediaJwpl wiki) |
Modifier and Type | Method and Description |
---|---|
void |
addScoredCategory(GroupOfCategories.ScoredCategory category)
Adds a new
ScoredCategory to the group. |
static GroupOfCategories.ScoredCategory |
createScoredCategory(Category cat,
Category parent,
int distance) |
static GroupOfCategories.ScoredCategory |
createScoredCategory(Category cat,
Category parent,
int distance,
boolean isDomain) |
java.util.Collection<GroupOfCategories.ScoredCategory> |
getCategories() |
Category |
getRoot() |
double |
getScore() |
GroupOfCategories.ScoredCategory |
removeScoredCategory(GroupOfCategories.ScoredCategory category) |
void |
toFile(java.io.File output) |
public GroupOfCategories(Category root)
root
- Root category of the group.public GroupOfCategories(java.io.File input, WikipediaJwpl wiki) throws java.io.IOException
java.io.IOException
public static GroupOfCategories.ScoredCategory createScoredCategory(Category cat, Category parent, int distance)
public static GroupOfCategories.ScoredCategory createScoredCategory(Category cat, Category parent, int distance, boolean isDomain)
public void addScoredCategory(GroupOfCategories.ScoredCategory category)
ScoredCategory
to the group.category
- The new scored categorypublic GroupOfCategories.ScoredCategory removeScoredCategory(GroupOfCategories.ScoredCategory category)
public void toFile(java.io.File output) throws java.io.IOException
java.io.IOException
public Category getRoot()
public java.util.Collection<GroupOfCategories.ScoredCategory> getCategories()
public double getScore()