public class TreePairRelTagger extends Object implements Manipulator
TreeNodeFilter
. Then the nodes
\(n_i^A \in S_A\) and the nodes \(n_i^B \in S_B\) become anchors if their similarity
evaluated with nodeSimilarity
is higher than simThreshold
.
Finally anchor nodes are marked using a markingPolicy
and the same marking
is applied to their ascendants (till upwardPropagation
generations) and
descendants (till downPropagation
generations).Modifier and Type | Class and Description |
---|---|
static class |
TreePairRelTagger.MARKING_POLICY
The marking policy applied by
TreePairRelTagger |
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_PREFIX |
Constructor and Description |
---|
TreePairRelTagger(int upwardPropagation,
int downwordPropagation,
String representation,
TreeNodeFilter nodeFilter,
TreePairRelTagger.MARKING_POLICY markingPolicy,
TreeNodeSimilarity nodeSimilarity,
float simThreshold)
Constructor for TreePairRelTagger
|
Modifier and Type | Method and Description |
---|---|
void |
establishNodeRelations(TreeRepresentation treeA,
TreeRepresentation treeB)
Establishes relations between
treeA and treeA
Let \(N_A=\left \{ n_1^A, n_2^A... |
String |
getMarkingPrefix()
Returns the prefix used to mark the related nodes
|
void |
manipulate(Example example) |
void |
setMarkingPrefix(String markingPrefix)
Sets the prefix used to mark the related nodes
|
public static final String DEFAULT_PREFIX
public TreePairRelTagger(int upwardPropagation, int downwordPropagation, String representation, TreeNodeFilter nodeFilter, TreePairRelTagger.MARKING_POLICY markingPolicy, TreeNodeSimilarity nodeSimilarity, float simThreshold)
NOTE: the related nodes will be marked using DEFAULT_PREFIX. To specify an alternative prefix
the setMarkingPrefix
can be used
upwardPropagation
- the number of generations of ascendants to which the mark is propagateddownwordPropagation
- the number of generations of descendants to which the mark is propagatedrepresentation
- the name of the tree representations that must be relatednodeFilter
- the policy to be applied in selecting potential anchor nodesmarkingPolicy
- the marking policy specifying what kind of mark must be appliednodeSimilarity
- the similarity metric between tree nodessimThreshold
- the similarity threshold that two nodes should overcome to be considered anchors (and then marked)public String getMarkingPrefix()
public void setMarkingPrefix(String markingPrefix)
markingPrefix
- the markingPrefix to setpublic void manipulate(Example example)
manipulate
in interface Manipulator
public void establishNodeRelations(TreeRepresentation treeA, TreeRepresentation treeB)
treeA
and treeA
Let \(N_A=\left \{ n_1^A, n_2^A... \right \}) be the nodes of treeA
and
\(N_B=\left \{ n_1^B, n_2^B... \right \}) be the nodes of treeB
,
the method firstly selects two subsets \(S_A \subseteq N_A\) and \(S_B \subseteq N_B\) according to the
filtering policy defined by a TreeNodeFilter
. Then the nodes
\(n_i^A \in S_A\) and the nodes \(n_i^B \in S_B\) become anchors if their similarity
evaluated with nodeSimilarity
is higher than simThreshold
.
Finally anchor nodes are marked using a markingPolicy
and the same marking
is applied to their ascendants (till upwardPropagation
generations) and
descendants (till downPropagation
generations).treeA
- treeB
- Copyright © 2018 Semantic Analytics Group @ Uniroma2. All rights reserved.