添加基于nltk的模板过滤器。
lektor-natural-language的Python项目详细描述
乐高自然语言
这是一个lektor插件,它使用自然语言工具包(nltk)提供了一些简单的模板过滤器。
它提供以下过滤器:
sentences_filter
接受文本字符串并返回其句子列表。
用法:{{ this.text|sentences }}
firstsentences_filter
接受文本字符串并返回其第一个句子。
用法:{{ this.text|firstsentence }}
sentences_filter
接受文本字符串并返回由nltk
的Rake
确定的关键字列表。
用法:{{ this.text|keywords }}