public class PruneNodeThresholdAndDistanceFromSpecificLabelledNode extends PruneNodeLowerThanThreshold
distance
whose
label starts with the prefix labelPrefix
2) the conditions specified in the parent classPruneNodeLowerThanThreshold.nodeComparisonOperator
Modifier and Type | Field and Description |
---|---|
protected int |
distance |
protected String |
labelPrefix |
avoidOrphans, defaultWeightValue, nodeComparisonType, threshold, weightField
Constructor and Description |
---|
PruneNodeThresholdAndDistanceFromSpecificLabelledNode(double threshold,
String labelPrefix) |
PruneNodeThresholdAndDistanceFromSpecificLabelledNode(double threshold,
String weightField,
boolean avoidOrphans,
double defaultWeightValue,
String labelPrefix,
int distance) |
Modifier and Type | Method and Description |
---|---|
String |
describe() |
protected void |
init(String labelPrefix,
int distance) |
boolean |
isNodeToBePruned(TreeNode node) |
static boolean |
noCloseNodeWithSpecificLabelPrefix(TreeNode node,
String labelPrefix,
int distance,
TreeNode previousNode)
Check if there is a node at a distance no greater than
distance
(the distance between a node and its neighbors is 1) whose label prefix
starts with labelPrefix . |
checkThresholdCondition, setComparisonTypeLowerThanAbsoluteValue, setComparisonTypeLowerThanValue, setDefaultWeightValue
initPruner
protected String labelPrefix
protected int distance
public PruneNodeThresholdAndDistanceFromSpecificLabelledNode(double threshold, String weightField, boolean avoidOrphans, double defaultWeightValue, String labelPrefix, int distance)
public PruneNodeThresholdAndDistanceFromSpecificLabelledNode(double threshold, String labelPrefix)
protected void init(String labelPrefix, int distance)
public static boolean noCloseNodeWithSpecificLabelPrefix(TreeNode node, String labelPrefix, int distance, TreeNode previousNode)
distance
(the distance between a node and its neighbors is 1) whose label prefix
starts with labelPrefix
.
It returns true if such node does not exists
Example of invocation: noCloseNodeWithSpecificLabelPrefix(node, "REL", 1, node)node
- TreeNodelabelPrefix
- prefix of node labeldistance
- number of steps of the visitpreviousNode
- used to avoid to call the recursive function on the same nodepublic boolean isNodeToBePruned(TreeNode node)
isNodeToBePruned
in class PruneNodeLowerThanThreshold
node
- a TreeNode objectpublic String describe()
describe
in class PruneNodeLowerThanThreshold
Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.