-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subtree matching, not all operations are returned #53
Comments
There was an error in my initial code of the APTED example. Now they do behave the same. The only difference seems to be that zss doesn't return all operations, unless I am missing something. |
The operations code was a external feature contribution (and I have to admit I haven't used it). There could very well be a bug in it -- and it certainly looks like B and D should have been removed. Since the distance being returned is correct my guess is the operations mapping is not correct. |
I think so, too. Unfortunately I don't have the time to look further into this. As per your suggestion over email, I will use APTED in the future. |
I ran into this problem earlier. Even simple trees seem to fail, for example from zss import Node, simple_distance
bar = Node("f")
foo = Node("f")\
.addkid(Node("a"))\
.addkid(Node("b"))\
.addkid(Node("c"))\
.addkid(Node("d"))
print(simple_distance(bar, foo, return_operations=True))
# (4.0, [<Operation Insert>, <Operation Match>]) |
Not really sure what the problem is or how to fix it, but comparing to implementations in other languages, there's a step that this library doesn't perform here: |
I'm not sure whether this is expected behaviour or not. I have two trees. One tree is basically the subtree of another where some nodes are dropped (B, C, E) and where one node has shifted a level(L).
Printed output:
When looking at the operations, though, I don't see any operations done on the labels 'B' and 'C'. Is that specific to the algorithm or the implementation?
As a comparison, here is the output of the same tree comparison with APTED:
Output of apted:
Thanks in advance!
The text was updated successfully, but these errors were encountered: