def __init__(self, fileids, path='~/nltk_data/corpora', mode='a', encoding='utf-8', trace=1):
		assert fileids and path and mode
		self.mode = mode
		self.encoding = encoding
		self.trace = trace or 0
		self.full_path = os.path.expanduser(path)
		
		for dirname in set([os.path.dirname(fileid) for fileid in fileids]):
			dirpath = os.path.join(self.full_path, dirname)
			
			if not os.path.exists(dirpath):
				if trace:
					print('making directory %s' % dirpath)
				
				os.makedirs(dirpath)
		
		self.fileids = [os.path.join(self.full_path, fileid) for fileid in fileids]
		self.files = {}
dataset/ETHPy150Open japerk/nltk-trainer/nltk_trainer/writer/__init__.py/CorpusWriter.__init__/original