Kernel.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:spqrel_tools 作者: LCAS 项目源码 文件源码
def _processSentence(self, elem, sessionID):
        """Process a <sentence> AIML element.

        <sentence> elements process their contents recursively, and
        then capitalize the first letter of the results.

        """
        response = ""
        for e in elem[2:]:
            response += self._processElement(e, sessionID)
        try:
            response = response.strip()
            words = string.split(response, " ", 1)
            words[0] = string.capitalize(words[0])
            response = string.join(words)
            return response
        except IndexError:  # response was empty
            return ""

    # <set>
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号