Skip to content
This repository was archived by the owner on Feb 8, 2024. It is now read-only.

Commit 4530308

Browse files
author
Cipher
committed
Fixed
1 parent 5a55e6e commit 4530308

File tree

10 files changed

+13
-12
lines changed

10 files changed

+13
-12
lines changed

Janex.egg-info/PKG-INFO

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: Janex
3-
Version: 0.0.35b0
3+
Version: 0.0.42
44
Home-page: https://github.com/Cipher58/Janex-Python
55
Download-URL: https://github.com/Cipher58/Janex-Python.git
66
Author: Cipher58

Janex/main.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def SynonymCompare(self, word):
233233

234234
def ResponseGenerator(self, most_similar_response):
235235

236-
deletion = '''!()-[]{};:'"\,<>./?@#$%^&*_~ '''
236+
deletion = '''!()-[]{};:'"\,<>./?@#$%^&*_~'''
237237

238238
punctuation = self.template(most_similar_response)
239239

@@ -249,9 +249,12 @@ def ResponseGenerator(self, most_similar_response):
249249
if token == word:
250250
syns = thesaurus[word]["synonyms"]
251251
new_word = random.choice(syns)
252+
if tokens[i].istitle():
253+
new_word = new_word[:1].upper() + new_word[1:]
252254
for x in deletion:
253-
if token.endswith(x):
254-
new_word = new_word + x
255+
if tokens[i].endswith(x):
256+
new_word = f"{new_word}{x}"
257+
break
255258
tokens[i] = new_word
256259

257260
syns = thesaurus[word]["synonyms"]
@@ -260,9 +263,12 @@ def ResponseGenerator(self, most_similar_response):
260263
if token == synonym:
261264
syns = thesaurus[word]["synonyms"]
262265
new_word = random.choice(syns)
266+
if tokens[i].istitle():
267+
new_word = new_word[1:].upper() + new_word[:1]
263268
for x in deletion:
264-
if token.endswith(x):
265-
new_word = new_word + x
269+
if tokens[i].endswith(x):
270+
new_word = f"{new_word}{x}"
271+
break
266272
tokens[i] = new_word
267273

268274
generated_response = " ".join(tokens)
@@ -276,11 +282,6 @@ def ResponseGenerator(self, most_similar_response):
276282
if token in ogtoken:
277283
generated_response = generated_response.replace(token, token+x)
278284

279-
for x in deletion:
280-
if most_similar_response.endswith(x):
281-
if not generated_response.endswith(x):
282-
generated_response = generated_response + x
283-
284285
generated_response = (f"{generated_response[:1].upper() + generated_response[1:]}")
285286

286287
return generated_response

dist/Janex-0.0.36.tar.gz

7.28 KB
Binary file not shown.

dist/Janex-0.0.37.tar.gz

7.31 KB
Binary file not shown.

dist/Janex-0.0.38.tar.gz

7.31 KB
Binary file not shown.

dist/Janex-0.0.39.tar.gz

7.3 KB
Binary file not shown.

dist/Janex-0.0.40.tar.gz

7.29 KB
Binary file not shown.

dist/Janex-0.0.41.tar.gz

7.32 KB
Binary file not shown.

dist/Janex-0.0.42.tar.gz

7.31 KB
Binary file not shown.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
name="Janex",
99

1010
# version of the module
11-
version="0.0.35b",
11+
version="0.0.42",
1212

1313
# Name of Author
1414
author="Cipher58",

0 commit comments

Comments
 (0)