コード例 #1
0
ファイル: andesay.py プロジェクト: askender/anwen.in
    def get_andesay(self, usersay, userip):
        andesay = ''
        andesay += '<br/>'
        p = Pinyin()
        userfenci = fenci(usersay)
        # userfenci = json.loads(userfenci)
        # city = p.get_pinyin(self.city)

        andesay += say.weather(usersay, userip)
        andesay += say.hello(usersay)
        andesay += say.song(usersay)

        andethink = ''
        andethink += '<br/>ande-think-trace, just for study'
        # andethink += '<br/>ande ip:' + get_ande_ip()
        andethink += '<br/>' + is_cn(usersay)
        andethink += '<br/>' + is_ascii(usersay)
        andethink += '<br/>' + userfenci
        andethink += '<br/>' + p.get_pinyin(usersay)
        #status = userfenci['words'][0]['attr']

        debug = True  # True False
        if debug:
            andesay += andethink

        return andesay
コード例 #2
0
ファイル: andesay.py プロジェクト: xiaocao/anwen.in
    def get_andesay(self, usersay, splitter=''):
        andesay = ''

        p = Pinyin()
        userfenci = fenci(usersay)
        userfencij = json.loads(userfenci)
        is_cn = self.is_cn(usersay)
        #city = p.get_pinyin(self.city)

        #andesay += sayweather(usersay,city)
        andesay += sayhello(usersay)
        andesay += saysong(usersay)

        andethink = ''
        andethink += '<br/>ande-think-trace,it will remove'
        andethink += '<br/>' + self.user_ip()
        andethink += '<br/>' + self.is_cn(usersay)
        andethink += '<br/>' + self.is_ascii(usersay)
        andethink += '<br/>' + userfenci
        andethink += '<br/>' + p.get_pinyin(usersay)
        andethink += '<br/>' + self.ip + '<br/>' + self.zipcode + '<br/>'
        andethink += '<br/>' + self.addr
        andethink += '<br/>' + self.provice  # +'<br/>'+self.city
        #status = userfenci['words'][0]['attr']
        #status += userfenci['words'][1]['attr']

        debug = True  # True False
        if debug:
            andesay += andethink

        return andesay