db4b9f4d50af9e83733fc301c32e85cbe6d9c812,conceptnet5/builders/json_to_solr.py,,convert_to_solr,#Any#Any#,12
Before Change
def convert_to_solr(in_stream=None, out_stream=None):
if in_stream is None:
in_stream = sys.stdin
if out_stream is None:
out_stream = sys.stdout
writer = SolrEdgeWriter(out_stream)
for line in in_stream:
if not line.strip():
continue
info = json.loads(line.strip().decode("utf-8"))
writer.write(info)
writer.close()
if __name__ == "__main__":
convert_to_solr()
After Change
if "surfaceText" in info and info["surfaceText"] is None:
del info["surfaceText"]
solr_struct = {"doc": info, "boost": boost}
solr_fragment = "\t"add": %s," % json.dumps(solr_struct)
print(solr_fragment, file=out)
print("\t"commit": {}", file=out)
print("}", file=out)
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 5
Instances 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: tensorpack/tensorpack
Commit Name: ba9d179311e86a6a7aed125970e7c5bd1c41627e
Time: 2019-08-21
Author: ppwwyyxx@users.noreply.github.com
File Name: tensorpack/dataflow/parallel.py
Class Name: _Worker
Method Name: run
Project Name: cve-search/cve-search
Commit Name: 0c11680229ec321925d9b244a72ea5e06a7c7a6f
Time: 2013-03-30
Author: a@foo.be
File Name: search_fulltext.py
Class Name:
Method Name:
Project Name: RasaHQ/rasa
Commit Name: 13e5fb6abb1223e377886469e48945477a7fcf28
Time: 2018-10-23
Author: alan@golastmile.com
File Name: rasa_core/training/structures.py
Class Name: Story
Method Name: as_story_string