|
@@ -211,14 +211,16 @@ def calculateLen(ss, i):
|
|
|
return front_len, back_len
|
|
|
|
|
|
|
|
|
-
|
|
|
def extract_bidway(text):
|
|
|
list_bidway = []
|
|
|
word, text_index_list = re_bidway(text)
|
|
|
if word is not None:
|
|
|
+ if text_index_list[1]-text_index_list[0] != len(word) \
|
|
|
+ or text_index_list[1]-text_index_list[0] >= 30:
|
|
|
+ return []
|
|
|
d = {"body": word, "begin_index": text_index_list[0], "end_index": text_index_list[1]}
|
|
|
list_bidway.append(d)
|
|
|
- # print(d)
|
|
|
+ # print(d.get("body"), d.get("begin_index"), d.get("end_index"))
|
|
|
return list_bidway
|
|
|
|
|
|
|