Skip to content

NlpGraph

Defined in: node.ts:38

nlpgraph — offline, deterministic Universal-Dependencies parsing in TypeScript.

This is the default (Node) entry. For the browser, import ‘nlpgraph/browser’.

import { NlpGraph } from ‘nlpgraph’; const nlp = await NlpGraph.load(); const doc = await nlp.parse(‘The system shall enforce access control.’);

parse(text): Promise<ParsedSentence[]>

Defined in: node.ts:50

Split text into sentences, tokenize, and dependency-parse each.

string

Promise<ParsedSentence[]>


parseTokens(words): Promise<DepToken[]>

Defined in: node.ts:55

Parse a single already-segmented sentence (array of word forms).

string[]

Promise<DepToken[]>


static load(opts?): Promise<NlpGraph>

Defined in: node.ts:41

LoadOptions = {}

Promise<NlpGraph>