Comments (5)
Did you mod the chatterbotapi.py file ?
Can you paste here whats in your chatterbotapi.py file, near the lines 73 and 144
from chatter-bot-api.
thought.text = text
return self.think_thought(thought).text
class ChatterBotThought:
pass
#################################################
Cleverbot impl
#################################################
class _Cleverbot(ChatterBot):
def __init__(self, baseUrl, serviceUrl, endIndex):
self.baseUrl = baseUrl
self.serviceUrl = serviceUrl
self.endIndex = endIndex
def create_session(self):
return _CleverbotSession(self)
class _CleverbotSession(ChatterBotSession):
def __init__(self, bot):
self.bot = bot
self.vars = OrderedDict()
#self.vars['start'] = 'y'
self.vars['stimulus'] = ''
self.vars['islearning'] = '1'
self.vars['icognoid'] = 'wsf'
#self.vars['fno'] = '0'
#self.vars['sub'] = 'Say'
#self.vars['cleanslate'] = 'false'
self.cookieJar = cookielib.CookieJar()
self.opener = build_opener(HTTPCookieProcessor(self.cookieJar))
self.opener.open(self.bot.baseUrl)
def think_thought(self, thought):
self.vars['stimulus'] = thought.text
data = urlencode(self.vars)
data_to_digest = data[9:self.bot.endIndex]
data_digest =
hashlib.md5(data_to_digest.encode('utf-8')).hexdigest()
data = data + '&icognocheck=' + data_digest
url_response = self.opener.open(self.bot.serviceUrl,
data.encode('utf-8'))
response = str(url_response.read())
response_values = re.split(r'\r|\r', response)
#self.vars['??'] = _utils_string_at_index(response_values, 0)
self.vars['sessionid'] = _utils_string_at_index(response_values, 1)
self.vars['logurl'] = _utils_string_at_index(response_values, 2)
self.vars['vText8'] = _utils_string_at_index(response_values, 3)
self.vars['vText7'] = _utils_string_at_index(response_values, 4)
self.vars['vText6'] = _utils_string_at_index(response_values, 5)
self.vars['vText5'] = _utils_string_at_index(response_values, 6)
self.vars['vText4'] = _utils_string_at_index(response_values, 7)
self.vars['vText3'] = _utils_string_at_index(response_values, 8)
self.vars['vText2'] = _utils_string_at_index(response_values, 9)
self.vars['prevref'] = _utils_string_at_index(response_values, 10)
#self.vars['??'] = _utils_string_at_index(response_values, 11)
self.vars['emotionalhistory'] =
_utils_string_at_index(response_values, 12)
self.vars['ttsLocMP3'] = _utils_string_at_index(response_values,
self.vars['ttsLocTXT'] = _utils_string_at_index(response_values,
self.vars['ttsLocTXT3'] = _utils_string_at_index(response_values,
self.vars['ttsText'] = _utils_string_at_index(response_values, 16)
self.vars['lineRef'] = _utils_string_at_index(response_values, 17)
self.vars['lineURL'] = _utils_string_at_index(response_values, 18)
self.vars['linePOST'] = _utils_string_at_index(response_values, 19)
self.vars['lineChoices'] = _utils_string_at_index(response_values,
self.vars['lineChoicesAbbrev'] =
_utils_string_at_index(response_values, 21)
self.vars['typingData'] = _utils_string_at_index(response_values,
self.vars['divert'] = _utils_string_at_index(response_values, 23)
response_thought = ChatterBotThought()
response_thought.text = _utils_string_at_index(response_values, 0)
On Tue, May 10, 2016 at 3:03 PM, Pierre-David Bélanger <
[email protected]> wrote:
Did you mod the chatterbotapi.py
https://github.com/pierredavidbelanger/chatter-bot-api/blob/master/python/chatterbotapi.py
file ?Can you paste here whats in your chatterbotapi.py
https://github.com/pierredavidbelanger/chatter-bot-api/blob/master/python/chatterbotapi.py
file, near the lines 73
https://github.com/pierredavidbelanger/chatter-bot-api/blob/master/python/chatterbotapi.py#L73
and 144
https://github.com/pierredavidbelanger/chatter-bot-api/blob/master/python/chatterbotapi.py#L144—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#27 (comment)
from chatter-bot-api.
This is strange.
I do not know your OS, or even if you are executing this is an terminal.
But, if you happen to use a unix like OS (linux or osx), execute the locale
command in a terminal and paste the output here.
It should give you something like this:
$ locale
LANG="fr_CA.UTF-8"
LC_COLLATE="fr_CA.UTF-8"
LC_CTYPE="fr_CA.UTF-8"
LC_MESSAGES="fr_CA.UTF-8"
LC_MONETARY="fr_CA.UTF-8"
LC_NUMERIC="fr_CA.UTF-8"
LC_TIME="fr_CA.UTF-8"
LC_ALL=
from chatter-bot-api.
I am running this on windows, with python idle but on another pc and it
doesn't do this
On May 11, 2016 3:01 PM, "Pierre-David Bélanger" [email protected]
wrote:
This is strange.
I do not know your OS, or even if you are executing this is an terminal.
But, if you happen to use a unix like OS (linux or osx), execute the
locale command in a terminal and paste the output here.
It should give you something like this:$ locale
LANG="fr_CA.UTF-8"
LC_COLLATE="fr_CA.UTF-8"
LC_CTYPE="fr_CA.UTF-8"
LC_MESSAGES="fr_CA.UTF-8"
LC_MONETARY="fr_CA.UTF-8"
LC_NUMERIC="fr_CA.UTF-8"
LC_TIME="fr_CA.UTF-8"
LC_ALL=—
You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#27 (comment)
from chatter-bot-api.
I do not have access to Windows, so I can not reproduce this strange bug.
Are you able to tel what is the difference between the two pc ?
Maybe the Python version, the OS locale, the IDE ..
Also, before your program (after the from chatterbotapi import ChatterBotFactory, ChatterBotType
), try putting those lines:
import locale
locale.setlocale(locale.LC_ALL, '')
Anyways, I guess it has something to do with your OS regional or locale settings.
from chatter-bot-api.
Related Issues (20)
- Getting 404 error from API HOT 8
- Cleverbot down HOT 2
- Pandora bot down HOT 1
- not support chinese question? HOT 1
- Default constructor cannot handle exception type Exception thrown by implicit super constructor. Must define an explicit constructor HOT 4
- Networking on main thread - Android issue HOT 6
- Cleverbot Webservice Link 404's HOT 13
- Cannot connect to the webserver of cleverbot HOT 11
- Change language of reply. HOT 3
- webservice error? HOT 8
- UC variable changed again HOT 5
- Hang on startup HOT 4
- CleverBot is not longer working
- org.xml.sax.SAXParseException; Premature end of file. HOT 3
- Any update on this? HOT 4
- The element type "hr" error -- JAVA HOT 3
- Java version wont work anymore HOT 1
- Issue running chatterbotapitest.py
- Cleverbot - HTTP/1.1 401 Unauthorized HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatter-bot-api.