semantic_skeleton.d.ts 1.4 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import { SemanticType, SemanticRole } from './semantic_meaning.js';
  2. import { SemanticNode } from './semantic_node.js';
  3. import { SemanticTree } from './semantic_tree.js';
  4. export type Sexp = number | Sexp[];
  5. export declare class SemanticSkeleton {
  6. array: Sexp;
  7. parents: {
  8. [key: number]: number[];
  9. };
  10. levelsMap: {
  11. [key: number]: Sexp[];
  12. };
  13. static fromTree(tree: SemanticTree): SemanticSkeleton;
  14. static fromNode(node: SemanticNode): SemanticSkeleton;
  15. static fromString(skel: string): SemanticSkeleton;
  16. static simpleCollapseStructure(strct: Sexp): boolean;
  17. static contentCollapseStructure(strct: Sexp): boolean;
  18. static interleaveIds(first: Sexp, second: Sexp): Sexp;
  19. static collapsedLeafs(...args: Sexp[]): number[];
  20. static fromStructure(mml: Element, tree: SemanticTree): SemanticSkeleton;
  21. static combineContentChildren<T>(type: SemanticType, _role: SemanticRole, content: T[], children: T[]): T[];
  22. private static makeSexp_;
  23. private static fromString_;
  24. private static fromNode_;
  25. private static tree_;
  26. private static addAria;
  27. private static addOwns_;
  28. private static realLeafs_;
  29. constructor(skeleton: Sexp);
  30. populate(): void;
  31. toString(): string;
  32. private populate_;
  33. isRoot(id: number): boolean;
  34. directChildren(id: number): number[];
  35. subtreeNodes(id: number): number[];
  36. }