Example #1
0
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)
Example #2
0
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
Example #3
0
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
Example #4
0
def testx():
    gm = GraphMaker(text='The cat sits on the mat.')
    print(gm.triples())
    print(gm.lemmas())
    print(gm.words())
    print(gm.tags())