用于确定文本观点(第一、第二、第三或未知)的python包。

pointofview的Python项目详细描述


Latest PyPI versionLatest Travis CI build statusLatest Codacy Coverage Report

用于确定文本观点(第一、第二、第三或未知)的python包。

安装

pointofview在pypi上可用。只需使用pip

安装
$ pip install pointofview

您也可以从源代码安装它:

$ git clone https://github.com/prosegrinder/python-pointofview.git
Cloning into 'python-pointofview'...
...

$ cd python-pointofview
$ python setup.py install
...

用法

pointofview通过计算视点代词来猜测文本的视点。主函数get_text_pov()将返回“first”、“second”、“third”或null(python的None对象):

>>> import pointofview
>>> text = "I'm a piece of text written in first person! What are you?"
>>> pointofview.get_text_pov(text)
'first'

还有另外两个助手函数。

get_word_pov()返回单个单词的视角:

>>> pointofview.get_word_pov("I")
'first'
>>> pointofview.get_word_pov("nope")
None

parse_pov_words返回包含所有第一、第二和第三人称pov单词的dict:

>>> text = """
... When I try to analyze my own cravings, motives, actions and so forth, I surrender to a sort of retrospective imagination which feeds the analytic faculty with boundless alternatives and which causes each visualized route to fork and re-fork without end in the maddeningly complex prospect of my past.
... """
>>> pointofview.parse_pov_words(text)
{'first': ['i', 'i'], 'second': [], 'third': []}

作者

视点David L. Day编写。

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

推荐PyPI第三方库


热门话题
在Java中超类的构造函数中获取扩展泛型类的泛型类型?   java如何获取实体A的不同记录,该实体A与另一个实体B有一对多的关联,并按B记录的最新时间戳的最大值排序   JavaJSF导航参数依赖关系   具有短密文的java SecretKey匿名IBE   鼠标事件“找不到符号”错误的java解决方案   调用mediaplayer后使用java。停止我不能再发出声音了。为我解释开发参考?   java如何在序列化Avro消息时传递空值   java Sip Servlet未发送邀请请求   java根据规则访问节点,并删除链表中所有未访问的节点   Java 6上的jmockit测试用例必须使用Java代理吗?   JSF转换器f:convertDateTime是如何工作的?   java如何清除Firebase云数据库中的数组?   基于日期的列表java自定义排序   测量Java对象的内存消耗(完全“在应用程序中”)   故障终止/崩溃时的javafx Java(FX)故障保护警报?   java访问名称编码未知的文件   java如何在BlackBerry中绘制实心正方形?   java从JTextArea中删除边框   java可以使用另一个bean的属性来引用spring容器XML配置   数据透视表中具有相同列索引的java计数列