hpprc commited on
Commit
0c4e08d
1 Parent(s): 487e277
Files changed (1) hide show
  1. en-ja-align.py +8 -8
en-ja-align.py CHANGED
@@ -66,17 +66,17 @@ def parse_html_table(path: Path):
66
  text_en, _, text_ja = (preprocess(td.text) for td in tr.find_all("td"))
67
  text_ja = unicodedata.normalize("NFKC", text_ja)
68
 
69
- cur_left_parens += min(text_en.count("("), 1)
70
- cur_right_parens += min(text_en.count(")"), 1)
71
 
72
- cur_left_quote += min(len(list(re.findall(r"``", text_en))), 1)
73
- cur_right_quote += min(len(list(re.findall(r"''", text_en))), 1)
74
 
75
- cur_left_parens_ja += min(text_ja.count("「"), 1)
76
- cur_right_parens_ja += min(text_ja.count("」"), 1)
77
 
78
- cur_left_parens_ja2 += min(text_ja.count("『"), 1)
79
- cur_right_parens_ja2 += min(text_ja.count("』"), 1)
80
 
81
  if (
82
  text_ja.strip().endswith("。")
 
66
  text_en, _, text_ja = (preprocess(td.text) for td in tr.find_all("td"))
67
  text_ja = unicodedata.normalize("NFKC", text_ja)
68
 
69
+ cur_left_parens += text_en.count("(")
70
+ cur_right_parens += text_en.count(")")
71
 
72
+ cur_left_quote += len(list(re.findall(r"``", text_en)))
73
+ cur_right_quote += len(list(re.findall(r"''", text_en)))
74
 
75
+ cur_left_parens_ja += text_ja.count("「")
76
+ cur_right_parens_ja += text_ja.count("」")
77
 
78
+ cur_left_parens_ja2 += text_ja.count("『")
79
+ cur_right_parens_ja2 += text_ja.count("』")
80
 
81
  if (
82
  text_ja.strip().endswith("。")