geneea-nlp-client
Version:
The TypeScript Client for Geneea Interpretor G3 API.
45 lines (44 loc) • 2.25 kB
TypeScript
import { Analysis } from "./analysis";
import { Token } from "./token";
import { Sentence } from "./sentence";
import { HasSentiment, Sentiment } from "./sentiment";
import { HasVectors, Vector } from "./vector";
import { TectoToken } from "./tecto-token";
import { HasId } from "../../common/id";
export declare class Paragraph implements HasId, HasSentiment, HasVectors {
readonly id: string;
type: string;
text: string;
origText: string;
sentences: Sentence[];
sentiment: Sentiment | null;
vectors: Vector[] | null;
/** Type of a paragraph representing a title of the whole document. Also used for email subjects. */
static readonly TYPE_TITLE = "TITLE";
/** Type of a paragraph representing an abstract (lead or perex) of the whole document. */
static readonly TYPE_ABSTRACT = "ABSTRACT";
/** Type of a paragraph containing regular text (for now this is used for the whole body of the document). */
static readonly TYPE_BODY = "BODY";
/** Type of a paragraph representing a section/chapter heading (not used yet). */
static readonly TYPE_SECTION_HEADING = "section_heading";
/** The full analysis object containing this paragraph. */
container: Analysis;
/**
*
* @param id ID of the paragraph used to refer to it from other objects.
* @param type Title, section heading, lead, body text, etc. For now, it is simply the segment type: title, lead, body.
* @param text The paragraph text, possibly after correction (token offsets link here).
* @param origText The original paragraph text as in the request.
* @param sentences The sentences the paragraph consists of.
* @param sentiment Optional sentiment of the paragraph.
* @param vectors Optional vectors for this paragraph.
*/
private constructor();
/** Paragraph factory method, public constructor. */
static of(id: string, type: string, text: string, origText?: string | null, sentences?: Sentence[] | null, sentiment?: Sentiment | null, vectors?: Vector[] | null): Paragraph;
/** Tokens across all sentences. */
tokens(): Iterable<Token>;
/** Tecto tokens across all sentences. */
tectoTokens(): Iterable<TectoToken>;
toString(): string;
}