def load_terms(self, terms):
<EOL>for t in terms:<EOL><INDENT>t.doc = self<EOL>if t.term_is('<STR_LIT>'):<EOL><INDENT>if not self.root:<EOL><INDENT>self.root = t<EOL>self.add_section(t)<EOL><DEDENT>continue<EOL><DEDENT>if t.term_is('<STR_LIT>'):<EOL><INDENT>self.add_section(t)<EOL><DEDENT>elif t.parent_term_lc == '<STR_LIT:root>':<EOL><INDENT>self.add_term(t)<EOL><DEDENT>else:<EOL><INDENT>assert t.parent is not None<EOL><DEDENT><DEDENT>try:<EOL><INDENT>dd = terms.declare_dict<EOL>self.decl_terms.update(dd['<STR_LIT>'])<EOL>self.decl_sections.update(dd['<STR_LIT>'])<EOL>self.super_terms.update(terms.super_terms())<EOL>kf = lambda e: e[<NUM_LIT:1>]  <EOL>self.derived_terms ={ k:set( e[<NUM_LIT:0>] for e in g)<EOL>for k, g in groupby(sorted(self.super_terms.items(), key=kf), kf)}<EOL><DEDENT>except AttributeError as e:<EOL><INDENT>pass<EOL><DEDENT>try:<EOL><INDENT>self.errors = terms.errors_as_dict()<EOL><DEDENT>except AttributeError:<EOL><INDENT>self.errors = {}<EOL><DEDENT>return self<EOL>
Create a builder from a sequence of terms, usually a TermInterpreter