                      stream = (proc(item) for item in stream)
          for doc in stream:
              yield doc
  
      def end_training(self, path=None):
          if path is None:
              path = self.path
          elif isinstance(path, basestring):
              path = pathlib.Path(path)
  
          if self.tagger:
              self.tagger.model.end_training()
              self.tagger.model.dump(str(path / 'pos' / 'model'))
          if self.parser:
 
</s> remove             self.tagger.model.end_training()
 </s> add  </s> remove         strings_loc = path / 'vocab' / 'strings.json'
        with strings_loc.open('w', encoding='utf8') as file_:
            self.vocab.strings.dump(file_)
        self.vocab.dump(path / 'vocab' / 'lexemes.bin')

 </s> add     def end_training(self, path=None): </s> remove     @contextmanager
    def train(cls, path, gold_tuples, *configs):
        if isinstance(path, basestring):
            path = pathlib.Path(path)
        tagger_cfg, parser_cfg, entity_cfg = configs
        dep_model_dir = path / 'deps'
        ner_model_dir = path / 'ner'
        pos_model_dir = path / 'pos'
        if dep_model_dir.exists():
            shutil.rmtree(str(dep_model_dir))
        if ner_model_dir.exists():
            shutil.rmtree(str(ner_model_dir))
        if pos_model_dir.exists():
            shutil.rmtree(str(pos_model_dir))
        dep_model_dir.mkdir()
        ner_model_dir.mkdir()
        pos_model_dir.mkdir()
 </s> add     def setup_directory(cls, path, **configs):
        for name, config in configs.items():
            directory = path / name
            if directory.exists():
                shutil.rmtree(str(directory))
            directory.mkdir()
            with (directory / 'config.json').open('wb') as file_:
                data = ujson.dumps(config, indent=2)
                if isinstance(data, unicode):
                    data = data.encode('utf8')
                file_.write(data)
        if not (path / 'vocab').exists():
            (path / 'vocab').mkdir() </s> remove             self.entity.model.end_training()
 </s> add 
    def save_to_directory(self, path):
        configs = {
            'pos': self.tagger.cfg if self.tagger else {},
            'deps': self.parser.cfg if self.parser else {},
            'ner': self.entity.cfg if self.entity else {},
        }
                      stream = (proc(item) for item in stream)
          for doc in stream:
              yield doc
  
    def save_to_directory(self, path):
        configs = {
            'pos': self.tagger.cfg if self.tagger else {},
            'deps': self.parser.cfg if self.parser else {},
            'ner': self.entity.cfg if self.entity else {},
        }
    def save_to_directory(self, path):
        configs = {
            'pos': self.tagger.cfg if self.tagger else {},
            'deps': self.parser.cfg if self.parser else {},
            'ner': self.entity.cfg if self.entity else {},
        }
    def save_to_directory(self, path):
        configs = {
            'pos': self.tagger.cfg if self.tagger else {},
            'deps': self.parser.cfg if self.parser else {},
            'ner': self.entity.cfg if self.entity else {},
        }
    def save_to_directory(self, path):
        configs = {
            'pos': self.tagger.cfg if self.tagger else {},
            'deps': self.parser.cfg if self.parser else {},
            'ner': self.entity.cfg if self.entity else {},
        }
    def save_to_directory(self, path):
        configs = {
            'pos': self.tagger.cfg if self.tagger else {},
            'deps': self.parser.cfg if self.parser else {},
            'ner': self.entity.cfg if self.entity else {},
        }
  
          if self.tagger:
              self.tagger.model.end_training()
              self.tagger.model.dump(str(path / 'pos' / 'model'))
          if self.parser:
keep keep keep keep replace replace replace replace replace keep keep keep keep keep
 Refactor Language.end_training, making new save_to_directory method 
spacy/language.py