★ wanayoo — archive 1999 https://github.com/udapi/udapi-python/issues/62Nouvelle recherche | Portail wanayoo
Skip to content
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

Problem with deps and Null Nodes #62

Open
francescomambrini opened this issue Oct 30, 2020 · 2 comments
Open

Problem with deps and Null Nodes #62

francescomambrini opened this issue Oct 30, 2020 · 2 comments

Comments

@francescomambrini
Copy link

@francescomambrini francescomambrini commented Oct 30, 2020 •

If you create an Empty Node with a decimal ord (e.g. 17.1) and set deps to it with something like: n.deps.append({'parent': empty, 'deprel': 'dep'}, only the whole part of the float is serialized by the CoNLL-U writer. Therefore, the wrong secondary edge is created in the CoNLL-U output (17:dep, instead of 17.1:dep).

I suspect the problem is in the raw_deps attribute of the Node class, lines 197-199:

 for secondary_dependence in self._deps:
                serialized_deps.append('%d:%s' % (secondary_dependence[
                    'parent'].ord, secondary_dependence['deprel']))

as %d will only return a whole number.

Thanks!

@martinpopel
Copy link
Contributor

@martinpopel martinpopel commented Oct 30, 2020

Thanks for the bugreport. This seems possible (empty nodes and enhanced deps are not well tested). Can you send a PR, please?
Ideally with a test. I am quite busy now even for such small bugfixes.

@francescomambrini
Copy link
Author

@francescomambrini francescomambrini commented Oct 31, 2020

Sure! I'll work on it.
It might be a bit complicated, because I played around with my fork (I didn't think I might actually have anything to contribute, but I'll be super-happy to do it). Rebasing everything is probably going to be the hardest part of the fix... :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.