def index(self, text, terms=None, **kwargs):
self.clear()<EOL>terms = terms or text.terms.keys()<EOL>pairs = combinations(terms, <NUM_LIT:2>)<EOL>count = comb(len(terms), <NUM_LIT:2>)<EOL>for t1, t2 in bar(pairs, expected_size=count, every=<NUM_LIT:1000>):<EOL><INDENT>score = text.score_braycurtis(t1, t2, **kwargs)<EOL>self.set_pair(t1, t2, score)<EOL><DEDENT>
Index all term pair distances.

Args:
    text (Text): The source text.
    terms (list): Terms to index.