From 8281f38609248fa80b482d1e9ec1fabaa207d23a Mon Sep 17 00:00:00 2001 From: jlowryduda Date: Wed, 29 Nov 2017 15:20:22 -0500 Subject: [PATCH] a comment in emoji explaining indexing --- conceptnet5/readers/emoji.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/conceptnet5/readers/emoji.py b/conceptnet5/readers/emoji.py index 8c9fb99d..6b1a4ce5 100644 --- a/conceptnet5/readers/emoji.py +++ b/conceptnet5/readers/emoji.py @@ -3,8 +3,7 @@ from conceptnet5.uri import Licenses from conceptnet5.nodes import standardized_concept_uri -import xml.etree.ElementTree as ET - +import xml.etree.ElementTree as ET REL = '/r/SymbolOf' DATASET = '/d/emoji' @@ -27,11 +26,11 @@ def handle_file(input_file, output_file): tree = ET.parse(input_file) out = MsgpackStreamWriter(output_file) root = tree.getroot() - lang = root[0][1].attrib['type'] + lang = root[0][1].attrib['type'] # language is at position [1] within the child node [0] for annotation in root[1]: - + for word in strip_words(annotation.text): - start = standardized_concept_uri('mul', annotation.attrib['cp']) + start = standardized_concept_uri('mul', annotation.attrib['cp']) end = standardized_concept_uri(lang, word) edge = make_edge(REL, start, end, DATASET, LICENSE, SOURCE) out.write(edge)