Object PageSummaryIndexService
-
- All Implemented Interfaces:
public class PageSummaryIndexService
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public final classPageSummaryIndexService.SummaryIndexedNodeIndexed DOM node, identified by its
viattribute (bounding box).public final classPageSummaryIndexService.SummaryScoredNodepublic final classPageSummaryIndexService.SummaryListGrouppublic final classPageSummaryIndexService.SummaryTableInfopublic final classPageSummaryIndexService.SummaryStatspublic final classPageSummaryIndexService.LinkInfoA single extracted link within a sample item.
public final classPageSummaryIndexService.LinkGroupItemOne sample item from a link group.
public final classPageSummaryIndexService.SummaryLinkGroupA detected link group — repeating visual card pattern containing links.
-
Field Summary
Fields Modifier and Type Field Description public final static PageSummaryIndexServiceINSTANCE
-
Method Summary
Modifier and Type Method Description final Stringgenerate(FeaturedDocument document, String pageUrl, String title)Generate a WPSI YAML summary from a FeaturedDocument. final List<PageSummaryIndexService.SummaryLinkGroup>detectLinkGroups(FeaturedDocument document)Detect link groups — coherent collections of item cards where each card contains one or more links. -
-
Method Detail
-
generate
final String generate(FeaturedDocument document, String pageUrl, String title)
Generate a WPSI YAML summary from a FeaturedDocument.
- Parameters:
document- The parsed DOM document (never mutated — the algorithm works on a clone).pageUrl- The normalized page URL.title- The page title (from FeaturedDocument.title).- Returns:
A YAML string suitable for saving to a
.ymlfile.
-
detectLinkGroups
final List<PageSummaryIndexService.SummaryLinkGroup> detectLinkGroups(FeaturedDocument document)
Detect link groups — coherent collections of item cards where each card contains one or more links.
Algorithm: cluster by visual geometry (bounding box), then walk up the DOM to find the nearest container element.
-
-
-
-