import Srl from "./Srl"; import TupleMap from "ts-json-key-map"; type TokensType = string[]; export type NodesType = [ number, // begin number, // end (exclusive) string // role label ][]; export type EdgesType = [ number[], // tails [number] // a single head ][]; function findNode(nodes:NodesType, begin:number, end:number, label:string):number { for(let i=0; i, * in Hypergraph format, a role is identified by * so this function returns the relationship between the two identifiers */ static parseSrlWithMap(srl:Srl):{ json:SrlJsonFormat, srlFrameRoleIndex_jsonNodeIndex:TupleMap<[number,number],number> } { const nodes:NodesType = [[0,srl.tokens.length,'&GOAL;']]; const edges:EdgesType = [[[],[0]]]; const predIndexes = edges[0][0]; // insert predicate indexes here later on const tupleMap = new TupleMap<[number,number],number>(); for(let frameIndex=0; frameIndex