def space_join(conllu,sentence_wise=False):
	"""Takes conllu input and returns:

	All tokens separated by space (if sentence_wise is False), OR
	A list of sentences, each a space separated string of tokens

	"""
	lines = conllu.replace("\r","").strip().split("\n")
	lines.append("")  # Ensure last blank
	just_text = []
	sentences = []
	length = 0
	for line in lines:
		if "\t" in line:
			fields = line.split("\t")
			if "." in fields[0]:  # ellipsis tokens
				continue
			if "-" in fields[0]:  # need to get super token and ignore next n tokens
				just_text.append(fields[1])
				start, end = fields[0].split("-")
				start = int(start)
				end = int(end)
				length = end-start+1
			else:
				if length > 0:
					length -= 1
					continue
				just_text.append(fields[1])
		elif len(line.strip())==0 and sentence_wise:  # New sentence
			sent_text = " ".join(just_text)
			sentences.append(sent_text)
			just_text = []

	if sentence_wise:
		return sentences
	else:
		text = " ".join(just_text)
		return text