从文本、html或url解析句子。

sentenceparser的Python项目详细描述


句子分析器

从文本、html或url解析句子。

安装

pip install sentenceparser

用法

使用cli解析文本文件中的句子:

sentenceparser from-text ~/Documents/text.txt

使用cli解析html文件中的句子:

sentenceparser from-html ~/Documents/site.html

使用cli解析url中的句子:

sentenceparser from-url 'https://example.com/'

使用cli解析url中的句子,并为每个句子添加行号:

sentenceparser from-url 'https://example.com/' --line-number

使用python api解析文本文件中的句子:

importsentenceparsertext='Lorem ipsum dolor sit amet consectetur adipisicing elit...'forsentenceinsentenceparser.from_text(text):print(sentence)

使用python api解析html文件中的句子:

importsentenceparserhtml='<p>Lorem ipsum dolor sit amet consectetur adipisicing elit.</p><p>...'forsentenceinsentenceparser.from_html(html):print(sentence)

使用python api解析url中的句子:

importsentenceparserforsentenceinsentenceparser.from_url('https://example.com/'):print(sentence)

开发

拉动:

git pull git@github.com:2tunnels/sentenceparser.git

安装:

pipenv install --dev

测试:

pytest

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java spring 3.2.0 classnotfoundexception   java如何读取文本文件中的字符串并提取单个字符?"0"   使用外部jar文件编译和运行java   Java:包含流的字符串中的数字之和   涉及位的Java Basic编程   java我无法在listview中居中显示文本   java如何将消息从活动发送到intentService?   java通过API调用从Instagram注销   Java泛型类型继承   无Java应用程序上下文的javascript AJAX调用   java如何打印数组索引号?   eclipsejava:删除(组件);不会立即移除按钮   java扫描动态加载类中的组件   tomcat如何将java web应用程序从eclipse传输到服务器   java我可以访问Sphere类的Geometry而不进行扩展吗?   java ArrayList编译器错误   从数据库到hashmap的java值给出了键和值的重复序列   Java BuffereImage:一个映像还是多个映像?   java我需要测试接口的每个实现来测试接口吗?