def testy(): gm = GraphMaker(text='The cat walks. The dog barks.') for g in gm.gs: print(g) for f, ft, r, t, tt in gm.edges(): print(f, '->', r, '->', t) pr = gm.pagerank() for w in pr.items(): print(w)
def testx(): gm = GraphMaker(text='The cat sits. The dog barks.') for e in gm.triples(): print(e) for f, ft, r, t, tt in gm.edges(): print(f, '->', r, '->', t) pr = gm.pagerank() for w in pr.items(): print(w) return gm
def runWithFilter(fileName, filter=maybeWord): gm = GraphMaker(file_name=fileName) fname = os.path.splitext(fileName)[0] dotName = fname + ".gv" cloudName = fname + "_cloud.pdf" gm.toDot(params.dot_count, filter, svo=True, fname=dotName, show=params.show) gm.kshow(params.dot_count, file_name=cloudName, show=params.show) return gm
def testx(): gm = GraphMaker(text='The cat sits on the mat.') print(gm.triples()) print(gm.lemmas()) print(gm.words()) print(gm.tags())