How to use the asrtoolkit.alignment.align_utils.find_matched_intervals function in asrtoolkit

To help you get started, we’ve selected a few asrtoolkit examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github finos / greenkey-asrtoolkit / asrtoolkit / alignment / aligned_doc.py View on Github external
def find_alignments(self, extract_id):
        all_matched_segments, all_unmatched_segments = [], []

        for interval in self.unmatched_intervals:
            matched_segments = find_matched_intervals(
                interval=interval, extractor=self.extractors[extract_id])

            if matched_segments:
                all_matched_segments.extend(matched_segments)

                unmatched_segments = self.find_unmatched_segments(
                    interval=interval, matched_segments=matched_segments)
                for segment in (unmatched_segments
                                if unmatched_segments is not None else []):
                    all_unmatched_segments.append(segment)
            else:
                all_unmatched_segments.extend(
                    interval if hasattr(interval, "__iter__") else [interval])

        if all_matched_segments:
            # unmatched segments