geneea-nlp-client
Version:
The TypeScript Client for Geneea Interpretor G3 API.
40 lines (39 loc) • 1.8 kB
TypeScript
import { Entity, EntityMention } from "./entity";
import { Node } from "./node";
import { Token, TokenSupport } from "./token";
/**
* A tecto token, i.e. a tectogrammatical abstraction of a word (e.g. "did not sleep" are three tokens but a single
* tecto-token)
* Tecto tokens have an zero-based index reflecting their position within their sentence.
*/
declare class TectoToken extends Node<TectoToken> {
readonly id: string;
readonly idx: number;
/** Label of the dependency edge. */
fnc: string;
/** Tecto lemma. */
lemma: string;
/** Grammatical and other features of the tecto token. */
feats: Map<string, string>;
/**
* Surface token corresponding to this tecto token; not necessarily adjacent; ordered by word-order;
* Might be null, because the root or dropped phrases have no surface realization.
*/
tokens: TokenSupport | null;
/** Entity mention associated with this tecto token; null if there is no such entity. */
entityMention: EntityMention | null;
/**
* Legacy value: Entity associated with this tecto token; null if there is no such entity.
* (Used only by F3, not by G3)
*/
entity: Entity | null;
private constructor();
/** TectoToken factory method, public constructor. */
static of(id: string, idx: number, fnc: string, lemma: string, feats?: Map<string, string> | null, tokens?: Token[] | null, entityMention?: EntityMention | null, entity?: Entity | null): TectoToken;
/** Converts the tecto token to a default non-recursive string: index + lemma. */
toSimpleString(): string;
/** Converts the token to a non-recursive string: index + [lemma] + [fnc]. */
toStringWith(lemma: boolean, fnc: boolean): string;
toString(): string;
}
export { TectoToken };