예제 #1
0
def getGraphLetter(letter):
    global count
    graph = Graph()

    node1 = Node(count, 'initial')
    count += 1
    node2 = Node(count, 'final')
    count += 1

    node1.addEdge(Edge(node1, node2, letter))

    graph.addNode(node1)
    graph.addNode(node2)

    return getInitialFinal(graph)
예제 #2
0
def getCopyGraph(graph):
    copy = Graph()

    for n in graph.getNodes():
        node = Node(n.name, n.category)
        copy.addNode(node)