Skip to content

Commit

Permalink
a comment in emoji explaining indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
jlowryduda committed Nov 29, 2017
1 parent 0c4ad55 commit 8281f38
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions conceptnet5/readers/emoji.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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)

0 comments on commit 8281f38

Please sign in to comment.