Skip to content

Commit

Permalink
ignore irrelevant rules
Browse files Browse the repository at this point in the history
  • Loading branch information
affemitkaraffe committed Sep 21, 2023
1 parent 933a24e commit 0735954
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scripts/cross_ling_appl.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,14 @@ def create_rows(dump_files, locale):
for file in dump_files:
for element in (file.rulegroups + file.rules):
for comment in element.comments:
rows.append([
datetime.strptime(comment.date, '%Y-%m-%d').date(),
locale, file.rel_path, element.id, element.sub_id,
','.join([tt.tag for tt in element.tone_tags]),
comment.tag, comment.content
])
regex = re.compile(r'\[derived from: [a-z]{2}]')
if comment.tag == "DESC" and not regex.search(comment.content):
rows.append([
datetime.strptime(comment.date, '%Y-%m-%d').date(),
locale, file.rel_path, element.id, element.sub_id,
','.join([tt.tag for tt in element.tone_tags]),
comment.tag, comment.content
])
return rows


Expand Down

0 comments on commit 0735954

Please sign in to comment.