public class ArticleFeatureExtractor extends DefaultFeatureExtractor
| Modifier and Type | Field and Description |
|---|---|
static double |
CENTERING_THRESHOLD
Maximal difference between left and right margin to consider the area to be centered (percentage of the parent area width)
|
static double[] |
DEFAULT_WEIGHTS |
static double |
MIN_MARKEDNESS_DIFFERENCE
Minimal difference in the markedness that should be interpreted as a difference between the meaning of the areas.
|
| Constructor and Description |
|---|
ArticleFeatureExtractor() |
| Modifier and Type | Method and Description |
|---|---|
static double |
colorLuminosity(Color c) |
weka.core.Instances |
createEmptyDataset()
Creates an empty data set containing the header appropriate to this extractor.
|
protected Set<org.fit.layout.model.Tag> |
getAllTags(org.fit.layout.model.Area area)
Obtains all the tags assigned to this area and its child areas (not all descendant areas).
|
weka.core.Instance |
getAreaFeatures(org.fit.layout.model.Area node,
weka.core.Instances dataset)
Creates a classification data instance from the given area.
|
double |
getAverageBoxColorLuminosity(org.fit.layout.model.Area area) |
FeatureVector |
getFeatureVector(org.fit.layout.model.Area node) |
double |
getIndentation(org.fit.layout.model.Area node)
Computes the indentation metric.
|
int |
getLineCount(org.fit.layout.model.Area a) |
double |
getMarkedness(org.fit.layout.model.Area node)
Computes the markedness of the area.
|
double |
getRelY(org.fit.layout.model.Area a) |
org.fit.layout.model.Area |
getTreeRoot()
Obtains the current tree root.
|
double[] |
getWeights() |
boolean |
isCentered(org.fit.layout.model.Area area)
Checks whether the area is horizontally centered within its parent area
|
void |
setTree(org.fit.layout.model.Area rootNode)
Initializes the extractor to use the tree with the given root node.
|
void |
setWeights(double[] weights) |
loadArffDatasetResourcepublic static final double MIN_MARKEDNESS_DIFFERENCE
public static final double[] DEFAULT_WEIGHTS
public static final double CENTERING_THRESHOLD
public void setTree(org.fit.layout.model.Area rootNode)
FeatureExtractorrootNode - the new area tree root nodepublic org.fit.layout.model.Area getTreeRoot()
FeatureExtractornull when the tree was not set before.public weka.core.Instances createEmptyDataset()
FeatureExtractorpublic weka.core.Instance getAreaFeatures(org.fit.layout.model.Area node,
weka.core.Instances dataset)
FeatureExtractornode - the area whose features should be computeddataset - the data set the created instance should belong topublic void setWeights(double[] weights)
public double[] getWeights()
public double getMarkedness(org.fit.layout.model.Area node)
public FeatureVector getFeatureVector(org.fit.layout.model.Area node)
public boolean isCentered(org.fit.layout.model.Area area)
true if the area is centeredpublic double getIndentation(org.fit.layout.model.Area node)
public double getAverageBoxColorLuminosity(org.fit.layout.model.Area area)
public static double colorLuminosity(Color c)
public double getRelY(org.fit.layout.model.Area a)
public int getLineCount(org.fit.layout.model.Area a)
protected Set<org.fit.layout.model.Tag> getAllTags(org.fit.layout.model.Area area)
Copyright © 2015. All rights reserved.