      if loc.is_dir():
          for filename in loc.iterdir():
              yield from read_json_file(loc / filename, limit=limit)
      else:
          with loc.open('r', encoding='utf8') as file_:
              docs = ujson.load(file_)
          if limit is not None:
              docs = docs[:limit]
          for doc in docs:
              if docs_filter is not None and not docs_filter(doc):
                  continue
              paragraphs = []
              for paragraph in doc['paragraphs']:
                  sents = []
 
</s> remove     @property
    def train_tuples(self):
 </s> add         # Write temp directory with one doc per file, so we can shuffle
        # and stream
        self.tmp_dir = Path(tempfile.mkdtemp())
        self.write_msgpack(self.tmp_dir / 'train', train)
        self.write_msgpack(self.tmp_dir / 'dev', dev)

    def __del__(self):
        shutil.rmtree(self.tmp_dir)

    @staticmethod
    def write_msgpack(directory, doc_tuples):
        if not directory.exists():
            directory.mkdir()
        for i, doc_tuple in enumerate(doc_tuples):
            with open(directory / '{}.msg'.format(i), 'wb') as file_:
                msgpack.dump([doc_tuple], file_, use_bin_type=True, encoding='utf8')
    
    @staticmethod
    def walk_corpus(path):
        path = util.ensure_path(path)
        if not path.is_dir():
            return [path]
        paths = [path]
        locs = []
        seen = set()
        for path in paths:
            if str(path) in seen:
                continue
            seen.add(str(path))
            if path.parts[-1].startswith('.'):
                continue
            elif path.is_dir():
                paths.extend(path.iterdir())
            elif path.parts[-1].endswith('.json'):
                locs.append(path)
        return locs

    @staticmethod
    def read_tuples(locs, limit=0): </s> remove     if not output_path.exists():
        output_path.mkdir()
 </s> add  </s> remove         for loc in self.train_locs:
            gold_tuples = read_json_file(loc)
 </s> add         for loc in locs:
            loc = util.ensure_path(loc)
            if loc.parts[-1].endswith('json'):
                gold_tuples = read_json_file(loc)
            elif loc.parts[-1].endswith('msg'):
                with loc.open('rb') as file_:
                    gold_tuples = msgpack.load(file_, encoding='utf8')
            else:
                msg = "Cannot read from file: %s. Supported formats: .json, .msg"
                raise ValueError(msg % loc) </s> remove                 pass
 </s> add                 if i in i2j_multi:
                    self.words[i] = words[i2j_multi[i]]
                    self.tags[i] = tags[i2j_multi[i]]
                    is_last = i2j_multi[i] != i2j_multi.get(i+1)
                    is_first = i2j_multi[i] != i2j_multi.get(i-1)
                    # Set next word in multi-token span as head, until last
                    if not is_last:
                        self.heads[i] = i+1
                        self.labels[i] = 'subtok'
                    else:
                        self.heads[i] = self.gold_to_cand[heads[i2j_multi[i]]]
                        self.labels[i] = deps[i2j_multi[i]]
                    # Now set NER...This is annoying because if we've split
                    # got an entity word split into two, we need to adjust the
                    # BILOU tags. We can't have BB or LL etc.
                    # Case 1: O -- easy.
                    ner_tag = entities[i2j_multi[i]]
                    if ner_tag == 'O':
                        self.ner[i] = 'O'
                    # Case 2: U. This has to become a B I* L sequence.
                    elif ner_tag.startswith('U-'):
                        if is_first:
                            self.ner[i] = ner_tag.replace('U-', 'B-', 1)
                        elif is_last:
                            self.ner[i] = ner_tag.replace('U-', 'L-', 1)
                        else:
                            self.ner[i] = ner_tag.replace('U-', 'I-', 1)
                    # Case 3: L. If not last, change to I.
                    elif ner_tag.startswith('L-'):
                        if is_last:
                            self.ner[i] = ner_tag
                        else:
                            self.ner[i] = ner_tag.replace('L-', 'I-', 1)
                    # Case 4: I. Stays correct
                    elif ner_tag.startswith('I-'):
                        self.ner[i] = ner_tag </s> remove                 self.tags[i] = 'SP'
 </s> add                 self.tags[i] = '_SP'
        for doc in _json_iterate(loc):
      if loc.is_dir():
          for filename in loc.iterdir():
              yield from read_json_file(loc / filename, limit=limit)
      else:
        for doc in _json_iterate(loc):
        for doc in _json_iterate(loc):
        for doc in _json_iterate(loc):
        for doc in _json_iterate(loc):
        for doc in _json_iterate(loc):
              if docs_filter is not None and not docs_filter(doc):
                  continue
              paragraphs = []
              for paragraph in doc['paragraphs']:
                  sents = []
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Revert "Merge branch 'develop' of https://github.com/explosion/spaCy into develop"

This reverts commit c9ba3d3c2dc7067cf8bd55f878cec45a8c6d73d4, reversing
changes made to 92c26a35d425d4e8ca1b805ea776ea10f5ded3df. 
spacy/gold.pyx