db4b9f4d50af9e83733fc301c32e85cbe6d9c812,conceptnet5/builders/json_to_csv.py,,convert_to_tab_separated,#Any#Any#,4
Before Change
out_stream = sys.stdout
for line in in_stream:
if not line.strip():
continue
info = json.loads(line.strip().decode("utf-8" ))
text = info.get(u"surfaceText" ) or ""
line = "%(uri)s\t%(rel)s\t%(start)s\t%(end)s\t%(context)s\t%(weight)s\t%(sources)s\t%(id)s\t%(dataset)s\t%(text)s" % {
"uri" : info[u"uri" ],
After Change
def convert_to_tab_separated (input_filename, output_filename) :
out_stream = codecs.open(output_filename, "w" , encoding="utf-8" )
for info in read_json_stream (input_filename) :
text = info.get("surfaceText" ) or ""
line = "%(uri)s\t%(rel)s\t%(start)s\t%(end)s\t%(context)s\t%(weight)s\t%(sources)s\t%(id)s\t%(dataset)s\t%(text)s" % {
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances Project Name: commonsense/conceptnet5
Commit Name: db4b9f4d50af9e83733fc301c32e85cbe6d9c812
Time: 2014-02-25
Author: rob@luminoso.com
File Name: conceptnet5/builders/json_to_csv.py
Class Name:
Method Name: convert_to_tab_separated
Project Name: commonsense/conceptnet5
Commit Name: db4b9f4d50af9e83733fc301c32e85cbe6d9c812
Time: 2014-02-25
Author: rob@luminoso.com
File Name: conceptnet5/builders/json_to_csv.py
Class Name:
Method Name: convert_to_tab_separated
Project Name: commonsense/conceptnet5
Commit Name: db4b9f4d50af9e83733fc301c32e85cbe6d9c812
Time: 2014-02-25
Author: rob@luminoso.com
File Name: conceptnet5/builders/json_to_solr.py
Class Name:
Method Name: convert_to_solr
Project Name: commonsense/conceptnet5
Commit Name: 33a339c5c08fc38a1fd49ad73e9cc130ceaf5d42
Time: 2014-02-25
Author: rob@luminoso.com
File Name: conceptnet5/builders/json_to_assoc.py
Class Name:
Method Name: convert_to_assoc