UNPKG

poplar-annotation

Version:

web-based annotation tool for natural language processing (NLP) needs, inspired by brat rapid annotation tool.

41 lines (40 loc) 1.4 kB
import { Base } from "../Infrastructure/Repository"; import { Store } from "./Store"; import { ConnectionCategory } from "./ConnectionCategory"; import { Label } from "./Label"; export declare namespace Connection { interface JSON { id: number; categoryId: number; fromId: number; toId: number; } class Entity { readonly id: number | null; readonly categoryId: number; readonly fromId: number; readonly toId: number; private readonly root; constructor(id: number | null, categoryId: number, fromId: number, toId: number, root: Store); get category(): ConnectionCategory.Entity; get from(): Label.Entity; get to(): Label.Entity; get priorLabel(): Label.Entity; get posteriorLabel(): Label.Entity; get json(): JSON; } interface Config { readonly allowMultipleConnection: "notAllowed" | "differentCategory" | "allowed"; } class Repository extends Base.Repository<Entity> { private config; constructor(config: Config); set(key: number, value: Entity): this; add(value: Entity): number; private againstMultipleConnectionRuleWith; } namespace Factory { function create(json: JSON, root: Store): Entity; function createAll(json: Array<JSON>, root: Store): Array<Entity>; } }