One function

_dict_empty_map_helper in pyconll/pyconll

The author described this change as Added test for misc parsing and fixed bug.. It counts as a record because the check below fails on the code as it stood at cb334e8b9 and passes on 1f7b6824b, with nothing else changed between the two runs.

Fix saved2018-07-05
Sharing licenceMIT · LICENSE
Change size+1 1

What the code was meant to do, written into the code itself as a docstring

A helper to consolidate logic between singleton and non-singleton mapping. Args: values: The value to parse. empty: The empty representation for this value in CoNLL-U format. delim: The delimiter between components of the value. av_separator: The separator between attribute and value in each component. v_delimiter: The delimiter between values for the same attribute. singleton: A flag to indicate if the value has singleton values or not. Returns: An empty dict if the value is empty and otherwise a parsed equivalent.

The change

2121 for el in values.split(delim):
2222 parts = el.split(av_separator)
2323 if len(parts) == 1:
24- k = parts
24+ k = parts[0]
2525 v = None
2626 elif len(parts) == 2:
2727 k, v = parts

The check that tells the two apart

failpass·tests/unit/test_token.py::test_misc_parsing

Check file tests/unit/test_token.py, taken without changes from the fix and copied onto the older code, so the exact same check runs against both versions.

Origin and history

The code before itcb334e8b9dade962e76f6996c43e147e99785088
Broken version dated2018-07-05
Modulepyconll.unit.token
Units changed_dict_empty_map_helper
Fingerprint4e34d546532aee7e
Checked2026-08-18 by goldset/0.1

Every field above is generated by our program. None of it is written by hand.

Other bugs found in pyconll/pyconll