diff --git a/PyPI/setup.cfg b/PyPI/setup.cfg index f68adc5..ac7cd73 100644 --- a/PyPI/setup.cfg +++ b/PyPI/setup.cfg @@ -1,7 +1,7 @@ [metadata] # replace with your username: name = guan -version = 0.1.194 +version = 0.1.195 author = guanjihuan author_email = guanjihuan@163.com description = An open source python package diff --git a/PyPI/src/guan.egg-info/PKG-INFO b/PyPI/src/guan.egg-info/PKG-INFO index f505837..4ecd3a6 100644 --- a/PyPI/src/guan.egg-info/PKG-INFO +++ b/PyPI/src/guan.egg-info/PKG-INFO @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: guan -Version: 0.1.194 +Version: 0.1.195 Summary: An open source python package Home-page: https://py.guanjihuan.com Author: guanjihuan diff --git a/PyPI/src/guan/data_processing.py b/PyPI/src/guan/data_processing.py index 56c1716..993020f 100644 --- a/PyPI/src/guan/data_processing.py +++ b/PyPI/src/guan/data_processing.py @@ -337,6 +337,14 @@ def run_programs_sequentially(program_files=['./a.py', './b.py'], execute='pytho end = time.time() print('Total running time = '+str((end-start)/60)+' min') +# 根据 “.” 和 “。” 符号进行分句 +def split_text_into_sentences(text): + import re + pattern = r'(?<=[。])|(?<=\.)(?=\s|$)' + sentences = re.split(pattern, text) + sentence_array = [s.strip() for s in sentences if s.strip()] + return sentence_array + # 根据一定的字符长度来分割文本 def split_text(text, width=100): split_text_list = [text[i:i+width] for i in range(0, len(text), width)] diff --git a/PyPI/src/guan/others.py b/PyPI/src/guan/others.py index e84722a..1b6406e 100644 --- a/PyPI/src/guan/others.py +++ b/PyPI/src/guan/others.py @@ -770,7 +770,7 @@ def creat_qrcode(data="https://www.guanjihuan.com", filename='a', file_format='. img = qrcode.make(data) img.save(filename+file_format) -# 通过Sci-Hub网站下载文献 +# 通过Sci-Hub网站下载文献(该方法可能失效) def download_with_scihub(address=None, num=1): from bs4 import BeautifulSoup import re