(chars: list)
| 877 | pos_key = itemgetter("doctop", "x0") |
| 878 | |
| 879 | def yield_unique_chars(chars: list): |
| 880 | sorted_chars = sorted(chars, key=key) |
| 881 | for grp, grp_chars in itertools.groupby(sorted_chars, key=key): |
| 882 | for y_cluster in cluster_objects( |
| 883 | list(grp_chars), itemgetter("doctop"), tolerance |
| 884 | ): |
| 885 | for x_cluster in cluster_objects( |
| 886 | y_cluster, itemgetter("x0"), tolerance |
| 887 | ): |
| 888 | yield sorted(x_cluster, key=pos_key)[0] |
| 889 | |
| 890 | deduped = yield_unique_chars(chars) |
| 891 | return sorted(deduped, key=chars.index) |
no test coverage detected
searching dependent graphs…