import { Tree } from './tree'; import { Triple } from './types'; /** * Parse a PENMAN-notation string `s` into its tree structure. * * @param s - A string containing a single PENMAN-serialized graph. * @returns The tree structure described by `s`. * @example * import { parse } from 'penman-js'; * * const tree = parse('(b / bark-01 :ARG0 (d / dog))'); * console.log(tree); * * // Tree(['b', [['/', 'bark-01'], [':ARG0', ['d', [['/', 'dog']]]]]) */ export declare const parse: (s: string) => Tree; /** * Yield trees parsed from `lines`. * * @param lines - A string or open file with PENMAN-serialized graphs. * @returns The `Tree` object described in `lines`. * @example * import { iterparse } from 'penman-js'; * * for (const t of iterparse('(a / alpha) (b / beta)')) { * console.log(t); * } * * // Tree(['a', [['/', 'alpha']]]) * // Tree(['b', [['/', 'beta']]]) */ export declare function iterparse(lines: Iterable | string): IterableIterator; /** * Parse a triple conjunction from `s`. * * @param s - A string containing the triple conjunction. * @returns An iterator yielding triples. * @example * import { parseTriples } from 'penman-js'; * * for (const triple of parseTriples(` * instance(b, bark) ^ * ARG0(b, d) ^ * instance(d, dog)`)) { * console.log(triple); * // ['b', ':instance', 'bark'] * // ['b', ':ARG0', 'd'] * // ['d', ':instance', 'dog'] * } */ export declare const parseTriples: (s: string) => Triple[];