MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / refine_runs

Method refine_runs

src/licensedcode/query.py:547–566  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

545 print()
546
547 def refine_runs(self):
548 # TODO: move me to the approximate matching loop so that this is done
549 # only if neeed rebreak query runs based on potential rule boundaries
550 query_runs = list(chain.from_iterable(
551 break_on_boundaries(qr) for qr in self.query_runs))
552
553 if TRACE_QR_BREAK:
554 logger_debug(
555 'Initial # query runs:', len(self.query_runs),
556 'after breaking:', len(query_runs),
557 )
558
559 self.query_runs = query_runs
560
561 if TRACE_QR:
562 print()
563 logger_debug('FINAL Query runs for query:', self.location)
564 for qr in self.query_runs:
565 print(' ' , repr(qr))
566 print()
567
568 def _tokenize_and_build_runs(self, tokens_by_line, line_threshold=4):
569 len_legalese = self.idx.len_legalese

Callers 1

Calls 2

break_on_boundariesFunction · 0.85
logger_debugFunction · 0.70

Tested by

no test coverage detected