Skip to content
This repository was archived by the owner on Sep 12, 2022. It is now read-only.

Commit a12c987

Browse files
author
realveli24@gmail.com
committed
Bug fix : When use the Turkish-->English Displaying The Junk Data issue fixed.
1 parent 362e68f commit a12c987

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

Pytureng/frames.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
frame_en = """O====O==============O=========O=========================================O
1+
frame_en = """ O====O==============O=========O=========================================O
22
| ## | Category | English | Türkce |
33
O====O==============O=========O=========================================O"""
44
frame_tr = """ O====O==============O=========O=========================================O

Pytureng/tureng.py

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,19 +73,22 @@ def writer(self, main_word, type, is_history=False):
7373
if counter2 < write_time+1:
7474
counter_sub = self.subject_dict.get(counter2)
7575
if counter_sub is not None:
76-
counter_sub = len(counter_sub)
77-
a = frames.frame2.format(
78-
str(counter2) + " " * (4 - len(str(counter2))),
79-
self.subject_dict.get(counter2) + (16 - counter_sub) * " ",
80-
main_word[0],
81-
i, )
82-
if counter2 == 1 or counter2 == 2:
83-
outcome_list.append(i)
84-
outcome_list.append(self.subject_dict.get(counter2))
85-
counter_a = len(a)
86-
a += ((82 - counter_a) * " " + "|")
87-
print(a)
88-
counter2 += 1
76+
i = i.replace("</td>", "").replace("</a> <i>i. </i>", "").replace("</a> <i> </i>", "")\
77+
.replace("</a>", "").replace("<i>", "").replace("</i>", "")
78+
if len(i) > 1:
79+
counter_sub = len(counter_sub)
80+
a = frames.frame2.format(
81+
str(counter2) + " " * (4 - len(str(counter2))),
82+
self.subject_dict.get(counter2) + (16 - counter_sub) * " ",
83+
main_word[0],
84+
i, )
85+
if counter2 == 1 or counter2 == 2:
86+
outcome_list.append(i)
87+
outcome_list.append(self.subject_dict.get(counter2))
88+
counter_a = len(a)
89+
a += ((82 - counter_a) * " " + "|")
90+
print(a)
91+
counter2 += 1
8992
else:
9093
break
9194
else:

0 commit comments

Comments
 (0)