public class StructureSiblingSetRule extends Object implements SiblingSetRule
SiblingSetPattern from siblings whose child structures overlap, instead
of their names: each candidate's structural signature is the set of its child element and
attribute names (looking through JSON object/array container nodes),
and siblings whose signatures agree above minimumSimilarity
(Jaccard overlap) form the collapse group.
This collapses siblings that are instances of the same entity even when their names share no
derivable affix (for example alpha, beta, gamma elements
with identical children), and refuses siblings that merely share a naming convention while
holding different content (for example Form ADV's Item3A/Item5B
sections, whose attribute sets do not overlap). Siblings without children are never clustered —
value-only leaf fields such as first_name/last_name are fields, not
repeating records.
The derived pattern is a closed set: it matches exactly the sibling names that formed the
cluster (with any shared affix contributing a field-name hint), unlike
AffixSiblingSetRule whose patterns also match future names with the same shape.
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_MINIMUM_SIBLINGS |
static double |
DEFAULT_MINIMUM_SIMILARITY |
| Constructor and Description |
|---|
StructureSiblingSetRule() |
| Modifier and Type | Method and Description |
|---|---|
SiblingSetPattern |
derivePattern(TreeNode parent,
List<TreeNode> candidateSiblings) |
int |
getMinimumSiblings() |
double |
getMinimumSimilarity() |
protected Set<String> |
getStructuralSignature(TreeNode node)
Returns the node's structural signature: the names of its element and attribute children,
looking through JSON
object/array container nodes to the entries
inside them. |
StructureSiblingSetRule |
setMinimumSiblings(int minimumSiblings)
Sets the minimum number of structurally similar siblings required to derive a pattern
(default 3, at least 2).
|
StructureSiblingSetRule |
setMinimumSimilarity(double minimumSimilarity)
Sets the minimum Jaccard overlap between sibling structural signatures (default
0.75; greater than 0, at most 1).
|
public static final int DEFAULT_MINIMUM_SIBLINGS
public static final double DEFAULT_MINIMUM_SIMILARITY
public int getMinimumSiblings()
public StructureSiblingSetRule setMinimumSiblings(int minimumSiblings)
public double getMinimumSimilarity()
public StructureSiblingSetRule setMinimumSimilarity(double minimumSimilarity)
public SiblingSetPattern derivePattern(TreeNode parent, List<TreeNode> candidateSiblings)
derivePattern in interface SiblingSetRuleCopyright (c) 2006-2026 North Concepts Inc. All Rights Reserved.