搭配俏皮话和其他俏皮话

helga-quip的Python项目详细描述


https://badge.fury.io/py/helga-quip.pnghttps://travis-ci.org/narfman0/helga-quip.png?branch=master

“总是用机智的反驳,那个” -引用一位英明的澳洲人的话 胡说八道

目的

搭配俏皮话和其他俏皮话。它注意到双关语,夸张, 隐喻和其他比喻。

用法

俏皮话可能被用来做一句俏皮话或是精心设计你妈妈,或者她就是这么说的。 笑话。语法为:

!quip add <quip_regex> <quip_kind>

俏皮话是一种你想要回应的俏皮话,可以是模板 回应。可能只是“你妈妈”或者“她就是这么说的”,但是用户 可能希望在响应中包含匹配的正则表达式。这可以用 {0},将替换为匹配的组。其他位置可能是 现在支持已使用或命名的组,类似于p<;名称>;表达式)。

quip_regex是要匹配的搜索正则表达式。任何正则表达式都应该 做,就像“听起来很难”。搜索不区分大小写。 如果有多个匹配项,将选择一个随机响应。

示例:

!quip add "(it|that|this) (sounds|is|was) really hard" "thats what she said"
<unwitting user>: i took this test last night, and it was really hard
<bot>: thats what she said
<unwitting user>: aww bot, your wit knows no bounds! ha ha!

示例2:

!quip add "(looks|is) really (leet|fat|awesome)" "your mom {0} really {1}"
<irc noob>: huh this game looks really awesome
<bot>: your mom looks really awesome
<irc noob>: oh bot! you and the jokes, they keep coming so hard!

示例3(命名的backreferences):

!quip add "(?:(?:i|he|you) (?:is|am)) (?P<action>excited|giddy)" "your mom is {action}"
<foolish scrub>: man, i am excited for the concert!
<bot>: your mom is excited
<foolish scrub>: YOUR MOM IS...
<foolish scrub> has left the chat

示例4(位置):

!quip add "[am|is] (lord|king) of (me|him|her|she|he)" "your mom is {0} of {1}"
<naive user>: ...man, i am lord of him! shot right in the face, and he wasn't doing nothin'!
<bot>: your mom is lord of him
<naive user> sobs at the truth of it all

!quip dump

使用“regex”“kind”条目转储到粘贴服务dpaste

许可证

版权所有(c)2016 Jon Robison

有关许可信息,请参见附带的许可证

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

推荐PyPI第三方库


热门话题
java Thumbnailator库将图像转换为cmyk   Java反射从目录中的类运行测试   JavaEclipseJDT编译器说方法未定义,但EclipseIDE没有   重构如何重构一行重复的java代码   java Eclipse:使用删除线文本呈现自定义注释   java问题与ArrayList复制数据   java如何在swagger中传递访问令牌?   使用另一个java文件运行java文件时出错   java为什么谷歌云存储生成的上传链接在成功上传后不会失效?   java将我的客户端PC重定向到默认登录页面   java hibernate c3p0配置mysql问题   java和java之间的区别。尼奥。文件文件和java。伊奥。文件   列出java循环并向映射中添加值   java为什么OJ报告这段代码的运行时错误?