LJAI is a personal chatbot hosted in my private server, available on the WeChat platform by searching 爱打滚的玲酱, and now available via the Web platform!
What makes LJAI different is the virtual and real mapping of our own cat. Recently, we have acquired over 120 users, and thousands of chat messages.
http://veritayuan.com/lingjiang
- Compared with the WeChat Version, this one only supports text message for now, and requires a Google authentication.
- It’s responsive on mobile devices and PC.
The chatbot now supports arbitrary chatting, face recognition (age, gender, score), idioms, riddles, twisters, map location search, zodiac, naming, English-Chinese dictionaries, and so on.
To chat with the WeChat version, please scan the following QR codes below:
The repository is now hosted on Github as a private repository. We will publish it when it’s ready. Here are some pieces of code which might be of interest to some of my readers.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
re_url = re.compile(u'(http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)') re_punctuation = re.compile(u"[\s+\.\!\/_,$%^*(+\"\']+|[+——!,。?、~@#¥%……&*()]+") re_points24 = re.compile("([+-]*\d+)[^\d]+([+-]*\d+)[^\d]+([+-]*\d+)[^\d]+([+-]*\d+)") re_braces = re.compile(u"[\(\)()]") re_phone = re.compile(r''' # don't match beginning of string, number can start anywhere (\d{3}) # area code is 3 digits (e.g. '800') \D* # optional separator is any number of non-digits (\d{3}) # trunk is 3 digits (e.g. '555') \D* # optional separator (\d{4}) # rest of number is 4 digits (e.g. '1212') \D* # optional separator (\d*) # extension is optional and can be any number of digits $ # end of string ''', re.VERBOSE) re_english = re.compile(u'([a-z\sA-Z&@0-9\'\"\.]+)') re_home = re.compile(u'([^\d]+)(\d+[\.。]?\d*)[$刀¥]?([^\d]*)') re_color_hex = re.compile(u"#[a-fA-F\d]{6}") states = [u"AL", u"AK", u"AZ", u"AR", u"CA", u"CO", u"CT", u"DC", u"DE", u"FL", u"GA", u"HI", u"ID", u"IL", u"IN", u"IA", u"KS", u"KY", u"LA", u"ME", u"MD", u"MA", u"MI", u"MN", u"MS", u"MO", u"MT", u"NE", u"NV", u"NH", u"NJ", u"NM", u"NY", u"NC", u"ND", u"OH", u"OK", u"OR", u"PA", u"RI", u"SC", u"SD", u"TN", u"TX", u"UT", u"VT", u"VA", u"WA", u"WV", u"WI", u"WY"] states_reg_str = u"(Maryland" for s in states: states_reg_str += u"|\,\s*" + s states_reg_str += u"|" + s + u"\s*\d{5}" states_reg_str += u")" # print states_reg_str re_states = re.compile(states_reg_str) re_gender1 = re.compile(u"男.*女") re_gender2 = re.compile(u"女.*男") re_zodiac = re.compile(u"(\d{1,2})[^\d]+(\d{1,2}).*星座") re_moe = re.compile(u"?????????") |