def insert(self, seq):
<EOL>self._els_idxed = defaultdict(lambda: defaultdict(set))<EOL>if type(seq) is str:<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>for el in seq:<EOL><INDENT>if type(el) is not str:<EOL><INDENT>raise ValueError('<STR_LIT>' % (el,))<EOL><DEDENT>for gram in make_unique_ngrams(el, self.idx_size):<EOL><INDENT>self._els_idxed[gram][len(el)].add(el)<EOL><DEDENT><DEDENT>self._finalize_db()<EOL>
Populates the DB from a sequence of strings, ERASING PREVIOUS STATE.

:param seq: an iterable