Skip to content

Tree is dict and list ? #6

@cdj0311

Description

@cdj0311

My tree is include dict and list, for example: data1 = {"a": [{"b": []}, {"c": [{"h":[]}]}]}, data2 = {"a": [{"b": [{"m":[]}]}, {"c": [{"h":[{"k":[]}]}]}]}, the edit distance always 1. The code:

from apted import APTED
from apted.helpers import Tree
data1 = {"a": [{"b": []}, {"c": [{"h":[]}]}]}
data2 = {"a": [{"b": [{"m":[]}]}, {"c": [{"h":[{"k":[]}]}]}]}
tree1 = Tree(data1)
tree2 = Tree(data2)
apted = APTED(tree1, tree2)
res = apted.compute_edit_distance()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions