49d41416e440926f0a9a8243b4d77f6f5468efe9,app/server/utils.py,CoNLLHandler,parse,#CoNLLHandler#Any#,100

Before Change


        for i, line in enumerate(file, start=1):
            line = line.decode("utf-8")
            line = line.strip()
            if line:
                try:
                    word, tag = line.split("\t")
                except ValueError:
                    raise FileParseException(line_num=i, line=line)
                words.append(word)
                tags.append(tag)
            else:
                yield words, tags
                words, tags = [], []
        if len(words) > 0:
            yield words, tags

    def render(self):

After Change


                yield data
                data = []
            try:
                j = json.loads(line)
                j["meta"] = json.dumps(j.get("meta", {}))
                data.append(j)
            except json.decoder.JSONDecodeError:
                raise FileParseException(line_num=i, line=line)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: chakki-works/doccano
Commit Name: 49d41416e440926f0a9a8243b4d77f6f5468efe9
Time: 2019-03-12
Author: light.tree.1.13@gmail.com
File Name: app/server/utils.py
Class Name: CoNLLHandler
Method Name: parse


Project Name: explosion/spaCy
Commit Name: 01858e9b5972a8c1dec86f88eef3f17fea63cdc6
Time: 2017-09-20
Author: honnibal+gh@gmail.com
File Name: examples/multi_word_matches.py
Class Name:
Method Name: read_gazetteer


Project Name: ray-project/ray
Commit Name: 0ba777af99e2d9dd8adf543f31860ea48f1acc05
Time: 2020-11-02
Author: swang@cs.berkeley.edu
File Name: python/ray/workers/default_worker.py
Class Name:
Method Name: