def __init__(self,
	             term_doc_matrix,
	             category_to_timestep_func,
	             is_gap_between_sequences_func,
	             timesteps_to_lag=4,
	             num_top_terms_each_timestep=10,
	             num_terms_to_include=40,
	             starting_time_step=None,
	             term_ranker=AbsoluteFrequencyRanker,
	             term_scorer=RankDifference()):
		'''
		Parameters
		----------
		term_doc_matrix : TermDocMatrix
		category_to_timestep_func : lambda
		is_gap_between_sequences_func : lambda
			timesteps_to_lag : int
		num_top_terms_each_timestep : int
		num_terms_to_include : int
		starting_time_step : object
		term_ranker : TermRanker
		term_scorer : TermScorer
		'''
		self.corpus = term_doc_matrix
		self.timesteps_to_lag = timesteps_to_lag
		self.num_top_terms_each_timestep = num_top_terms_each_timestep
		self.num_terms_to_include = num_terms_to_include
		self.is_gap_between_sequences_func = is_gap_between_sequences_func
		self.category_to_timestep_func = category_to_timestep_func
		self.term_ranker = term_ranker
		self.term_scorer = term_scorer
		categories = list(sorted(self.corpus.get_categories()))
		if len(categories) <= timesteps_to_lag:
			raise Exception("The number of categories in the term doc matrix is <= "
			                + str(timesteps_to_lag))
		if starting_time_step is None:
			starting_time_step = categories[timesteps_to_lag + 1]
		self.starting_time_step = starting_time_step

		Parameters
		----------
		term_doc_matrix : TermDocMatrix
		category_to_timestep_func : lambda
		is_gap_between_sequences_func : lambda
			timesteps_to_lag : int
		num_top_terms_each_timestep : int
		num_terms_to_include : int
		starting_time_step : object
		term_ranker : TermRanker
		term_scorer : TermScorer
		
scattertext/diachronic/GanttChart.py