semantic-analysis
Version:
Extensible semantic Structured Data analysis library for Microdata and JSON-LD
43 lines (42 loc) • 1.49 kB
TypeScript
import { IExtractionResult, IExtractor } from "./IExtractor";
import '../../util';
import DocumentHandler from '../../tools/DocumentHandler';
/**
* Microdata extraction according to HTML specification
* @see https://html.spec.whatwg.org/multipage/microdata.html#converting-html-to-other-formats
*/
export declare class MicrodataExtractor implements IExtractor {
private readonly doc;
private readonly meta;
constructor(doc: DocumentHandler);
/**
* Extracts items according to HTML specification in format similar to JSON
* @see https://html.spec.whatwg.org/multipage/microdata.html#json
* @returns Returns an extraction result
*/
extract(): Readonly<IExtractionResult>;
/**
* Finds top-level items
* @see https://html.spec.whatwg.org/multipage/microdata.html#json
*/
private findItems;
/**
* Creates a new item
* @see https://html.spec.whatwg.org/multipage/microdata.html#get-the-object
* @param element Element to create item from
* @param memory Memory of used elements
*/
private createItem;
/**
* Parse types of an item element
* @see https://html.spec.whatwg.org/multipage/microdata.html#item-types
* @param element Element to parse
*/
private parseType;
/**
* Find properties in root
* @see https://html.spec.whatwg.org/multipage/microdata.html#the-properties-of-an-item
* @param root Element to start
*/
private findProperties;
}