Commit 13fc199b by Steven Bird

Merge pull request #892 from oplatek/dependecygraph_default_node

Populating each DependencyGraph node(aka dictionary) with all the keys
parents 31c4d548 4c9fa392
......@@ -50,14 +50,21 @@ class DependencyGraph(object):
are split by whitespace.
"""
self.nodes = defaultdict(lambda: {'deps': defaultdict(list)})
self.nodes = defaultdict(lambda: {'address': None,
'word': None,
'lemma': None,
'ctag': None,
'tag': None,
'feats': None,
'head': None,
'deps': defaultdict(list),
'rel': None,
})
self.nodes[0].update(
{
'word': None,
'lemma': None,
'ctag': 'TOP',
'tag': 'TOP',
'feats': None,
'rel': 'TOP',
'address': 0,
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment