Skip to content

Commit 4efcf2b

Browse files
committed
RFCT simplified code
1 parent 9b4fab6 commit 4efcf2b

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

ch05/so_xml_to_tsv.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,14 @@ def filter_html(s):
6262

6363
link_count -= link_count_in_code
6464

65-
html_free_s = re.sub(
65+
link_free_s = re.sub(
6666
" +", " ", tag_match.sub('', code_free_s)).replace("\n", "")
6767

68-
link_free_s = html_free_s
6968
for link in links:
7069
if link.lower().startswith("http://"):
7170
link_free_s = link_free_s.replace(link, '')
7271

73-
num_text_tokens = html_free_s.count(" ")
72+
num_text_tokens = link_free_s.count(" ")
7473

7574
return link_free_s, num_text_tokens, num_code_lines, link_count, num_images
7675

0 commit comments

Comments
 (0)