rstfinder
rstfinder copied to clipboard
collapse_rst_labels.py could be cleaned up a bit
Some of the regular expressions are a bit unnecessarily complicated (e.g., including extraneous instances of .*), and in some cases, perhaps str.startswith could be used instead of re.search.
Note that there is some inconsistency with escaping - in the regular expressions, but python deals with this fine.
e.g.,
elif re.search(r'^(topic-.*)', relation_lc):
vs.
elif re.search(r'^(temporal\-.*|sequence|inverted\-sequence)',