搭配俏皮话和其他俏皮话

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为什么我们不能将ArrayList<Integer>传递给具有(Integer…)的方法参数   java Spring RestTemplate映射JSON对映射的响应引发不匹配的PutException   在系统中找到java Selenium元素,但在Jenkins中未找到   java在Android中使用JavaMail API发送电子邮件,而不使用默认/内置应用程序   数组如何在Java数据结构中同时存储数字和相应的单词?   为什么“+”运算符未定义?JAVA   java如何在游戏中添加高分系统?   java在球门碰撞中区分球和球员   java如何使用SpringSecurity4.0.1使用Auth令牌实现Rest完整Web服务。释放   java如何解决这个错误:Android资源链接失败?   java多线程文件处理和数据库批插入   导致Tomcat失败的java无用块线程   java主线程做了太多的工作,尽管我使用了异步线程(laggy UI)   在Java FX 2.0中滚动锚定节点时,锚定始终可见?   java使用EJB3中的客户机jar和设计模式