merl 0.1.3__py3-none-any.whl → 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
merl/merl.py CHANGED
@@ -10,6 +10,7 @@ p.s. Hi, PhoenixSC!
10
10
  import time
11
11
  import random
12
12
  import re
13
+ import merlkov
13
14
 
14
15
  CURSOR_UP = "\033[1A"
15
16
  CLEAR = "\x1b[2K"
@@ -27,8 +28,7 @@ ope = ["plus", "minus", "times", "divided by"]
27
28
 
28
29
 
29
30
  # Oops! Can't have users cursing in MY module!
30
- # We don't want to have a repeat of Project Gray Kiwi, now do we?
31
- banned = ["pee", "poo", "fuc", "shi", "damn", " hell ", "nig", "bitc", "craft a", "kil", "unaliv", "die", "slas", "end update", "viola", "dam", "frick", "hecking", "sex", "nut", "virgin", "weed", "sucks", "sybau", "shut up", "shut it", "feral", "shish", "gang", "diarrhea"]
31
+ banned = [" ass", "pee", "poo", "fuc", "shi", "damn", " hell ", "nig", "bitc", "craft a", "kil", "unaliv", "die", "slas", "end update", "viola", "dam", "frick", "hecking", "sex", "nut", "virgin", "weed", "sucks", "sybau", "shut up", "shut it", "feral", "shish", "gang", "diarrhea"]
32
32
 
33
33
  # in case ppl ask about the future!
34
34
  future = ["update", "snapshot", "rerelea", "preview", "leak", "spoiler"]
@@ -114,6 +114,14 @@ def replyMsg(cate: str):
114
114
  a = f"{a}{reply[cate][x]}"
115
115
  return a
116
116
 
117
+ def markprintanim(msg: str):
118
+ split_msg = msg.split()
119
+ f = ""
120
+ for x in range(len(split_msg)):
121
+ f = f"{f} {split_msg[x]}"
122
+ if x % 7 == 0: print(""); f = split_msg[x]
123
+ print(CLEAR_LINE, f)
124
+ time.sleep(0.1)
117
125
 
118
126
  def printanim(msg: str):
119
127
  split_msg = msg.split()
@@ -148,15 +156,15 @@ def sendRaw(prompt: str):
148
156
  if hour >= 9 and hour <= 16 and random.randint(0, 16) < 4:
149
157
  return replyMsg("busy")
150
158
  else:
151
- if any(sub.lower() in prompt.lower() for sub in copyin): return replyMsg("copy")
159
+ if any(sub.lower() in prompt.lower() for sub in copyin): return merlkov.retmark(merlkov.msg_copy)
152
160
  elif any(sub.lower() in prompt.lower() for sub in banned): return replyMsg("languageViolation")
153
161
  elif any(sub.lower() in prompt.lower() for sub in capable): return replyMsg("cap")
154
- elif any(sub.lower() in prompt.lower() for sub in future): return replyMsg("update")
155
- elif any(sub.lower() in prompt.lower() for sub in pb): return replyMsg("pb")
162
+ elif any(sub.lower() in prompt.lower() for sub in future): return merlkov.retmark(merlkov.msg_update)
163
+ elif any(sub.lower() in prompt.lower() for sub in pb): return merlkov.retmark(merlkov.msg_pb)
156
164
  elif any(sub.lower() in prompt.lower() for sub in help): return replyMsg("iCanHelp") # can you really?
157
165
  elif any(sub.lower() in prompt.lower() for sub in mine): return replyMsg("minecraft")
158
- elif any(sub.lower() in prompt.lower() for sub in cj): return replyMsg("movie")
159
- elif any(sub.lower() in prompt.lower() for sub in greet): return replyMsg("greet")
166
+ elif any(sub.lower() in prompt.lower() for sub in cj): return merlkov.retmark(merlkov.msg_movie)
167
+ elif any(sub.lower() in prompt.lower() for sub in greet): return merlkov.retmark(merlkov.msg_greet)
160
168
  else:
161
169
  if result != None:
162
170
  return restring
@@ -196,23 +204,23 @@ def replyPrint(prompt: str):
196
204
  for x in range(len(reply["busy"])): printanim(reply["busy"][x])
197
205
  else:
198
206
  if any(sub.lower() in prompt.lower() for sub in copyin):
199
- for x in range(len(reply["copy"])): printanim(reply["copy"][x])
207
+ markprintanim(merlkov.retmark(merlkov.msg_copy))
200
208
  elif any(sub.lower() in prompt.lower() for sub in banned):
201
209
  for x in range(len(reply["languageViolation"])): printanim(reply["languageViolation"][x])
202
210
  elif any(sub.lower() in prompt.lower() for sub in capable):
203
211
  for x in range(len(reply["cap"])): printanim(reply["cap"][x])
204
212
  elif any(sub.lower() in prompt.lower() for sub in future):
205
- for x in range(len(reply["update"])): printanim(reply["update"][x])
213
+ markprintanim(merlkov.retmark(merlkov.msg_update))
206
214
  elif any(sub.lower() in prompt.lower() for sub in pb):
207
- for x in range(len(reply["pb"])): printanim(reply["pb"][x])
215
+ markprintanim(merlkov.retmark(merlkov.msg_pb))
208
216
  elif any(sub.lower() in prompt.lower() for sub in help):
209
217
  for x in range(len(reply["iCanHelp"])): printanim(reply["iCanHelp"][x])
210
218
  elif any(sub.lower() in prompt.lower() for sub in mine):
211
219
  printanim("Minecraft!") # the thing that won't change.
212
220
  elif any(sub.lower() in prompt.lower() for sub in cj):
213
- for x in range(len(reply["movie"])): printanim(reply["movie"][x])
221
+ markprintanim(merlkov.retmark(merlkov.msg_movie))
214
222
  elif any(sub.lower() in prompt.lower() for sub in greet):
215
- for x in range(len(reply["greet"])): printanim(reply["greet"][x])
223
+ markprintanim(merlkov.retmark(merlkov.msg_greet))
216
224
  else:
217
225
  if result != None:
218
226
  printanim(restring)
merl/merlkov.py ADDED
@@ -0,0 +1,145 @@
1
+ # Merl isn't the most intelligent AI, so to mimic that,
2
+ # I will fill them with a bit more... personality! Meet
3
+ # my Markov Chain Engine. Cool, isn't it?
4
+ # Of course, this only adds a *little* variation to
5
+ # Merl's responses, and even then some chains aren't
6
+ # perfect (looking at you, 'msg_pb'!).
7
+
8
+ import random
9
+
10
+ msg_blank = {
11
+ "_init_" : [["1", "2"], [1, 1]],
12
+ " S" : [[" o", " b"],[1, 1]],
13
+ "a" : [["blank"], [1]]
14
+ }
15
+
16
+ msg_test_jackenstien = {
17
+ "_init_" : [["YOUR", "YOU'RE"], [1, 1]],
18
+ "YOUR" : [[" TAKING", " TOO", " LONG"], [3, 1, 1]],
19
+ " TAKING" : [[" TOO"], [1]],
20
+ " TOO" : [[" LONG!", " TOO!"], [2, 1]],
21
+ "YOU'RE" : [[" TAKING", " TOO", " LONG"], [3, 1, 1]]
22
+ }
23
+
24
+ msg_pineapple = {
25
+ "_init_" : [["I", "No, I"], [1, 1]],
26
+ "I" : [[" hate", " don't like"],[1, 1]],
27
+ "No, I" : [[" hate", " don't like"],[1, 1]],
28
+ " hate" : [[" pineapples...", " pineapples!"],[1, 1]],
29
+ " don't like" : [[" pineapples."], [1]]
30
+ }
31
+
32
+ # by the way i made these without using trees or diagrams on sheets of
33
+ # paper, so maybe that's why they're flawed.
34
+ # eh, i'll fix it in the next update. or not. i don't care right now!!
35
+
36
+ msg_update = {
37
+ "_init_" : [["If you", "Do you", "Are you"], [8, 1, 8]],
38
+ "If you" : [[" are asking about the next", " wish to know the next"],[1, 1]],
39
+ " are asking about the next" : [[" update, prerelease, or preview, then", " update, then"],[1, 1]],
40
+ " update, prerelease, or preview, then" : [[" sorry.", " I cannot answer that."],[4, 1]],
41
+ " update, then" : [[" sorry. I don't know that yet.", " sorry, but I don't have the data available to see what it is."],[3, 1]],
42
+ " wish to know the next" : [[" update, then"],[1]],
43
+ " wishing to know the next" : [[" update? If so, I cannot provide that information yet. Is there anything else that I can help you with?"],[1]],
44
+ "Do you" : [[" want to know about the next update? Because I do, too. I don't know what it is, but I'll gladly tell you all about it when it releases!", " want to die?"],[100, 1]], # do you want to die?
45
+ "Are you" : [[" asking about the next", " wishing to know the next"],[1, 1]],
46
+ " asking about the next" : [[" updates? Because I don't know about them either.", " versions/drops of Minecraft? Because I don't know about that, either."],[1, 4]],
47
+ " want to die?" : [[" AGAIN?", "?"], [1, 100]]
48
+ }
49
+
50
+ msg_copy = {
51
+ "_init_" : [["I'm sorry, but", "It appears that you are"], [1, 1]],
52
+ "I'm sorry, but" : [[" as an AI assistant, I", " it appears that you are"],[3, 1]],
53
+ "It appears that you are" : [[" intentionally", " copying"],[1, 2]],
54
+ " it appears that you are" : [[" intentionally", " copying"],[2, 1]],
55
+ " intentionally" : [[" copying"],[1]],
56
+ " copying" : [[" me.", " my most frequent messages."],[1, 1]],
57
+ " me." : [[" Is there"],[1]],
58
+ " as an AI assistant, I" : [[" am designed to be", " cannot stand you."],[100, 1]],
59
+ " am designed to be" : [[" your guide", " a helper for all your Minecraft needs."],[1, 1]],
60
+ " a helper for all your Minecraft needs." : [[" Is there"],[1]],
61
+ " your guide" : [[" to everything", " in regards", " for anything"],[2, 1, 2]],
62
+ " to everything" : [[" related to", " Minecraft."],[1, 1]],
63
+ " related to" : [[" Minecraft."],[1]],
64
+ " in regards" : [[" to everything"],[1]],
65
+ " to everything" : [[" related to Minecraft.", " Minecraft-related."],[1, 1]],
66
+ " related to Minecraft." : [[" Is there"], [1]],
67
+ " Minecraft-related." : [[" Is there"], [1]],
68
+ " Is there" : [[" anything else you want me to", " any other way I could"],[1, 1]],
69
+ " anything else you want me to" : [[" help with,"],[1]],
70
+ " any other way I could" : [[" help?", " help,"],[1, 8]],
71
+ " help with," : [[" besides being something to copy?", " besides being someone to copy?"],[8, 1]],
72
+ " help," : [[" besides being something to copy?", " besides being someone to copy?"],[10, 1]]
73
+ }
74
+
75
+ msg_greet = {
76
+ "_init_" : [["Hello", "Hi", "Greetings!", "..not YOU again."], [100, 100, 100, 1]],
77
+ "Hello" : [[" there", "! I am Merl", "! I am M"],[6, 7, 1]],
78
+ "! I am M" : [["M", "erl"],[9, 5]],
79
+ "M" : [["M", "erl"],[19, 1]],
80
+ "erl" : [[", your"],[1]],
81
+ "Hi" : [[" there", "! I am Merl"],[1, 1]],
82
+ "Greetings!" : [[" I am Merl", " My name is Merl"],[1, 1]],
83
+ " there" : [[", I am Merl", "! I am Merl"],[1, 1]],
84
+ ", I am Merl" : [[", your", ". How can I help you today"],[1, 1]],
85
+ "! I am Merl" : [[", your", ". How can I help you today"],[1, 1]],
86
+ " I am Merl" : [[", your", ". How can I help you today"],[1, 1]],
87
+ " My name is Merl" : [[", your", ". How can I help you today"],[1, 1]],
88
+ ", your" : [[" assistant for all things Minecraft", " AI-Powered"],[1, 1]],
89
+ " AI-Powered" : [[" assistant for all things Minecraft"],[1]],
90
+ " assistant for all things Minecraft" : [["!"],[1]],
91
+ ". How can I help you today" : [[" on the topic of Minecraft?", "?"],[1, 1]]
92
+ }
93
+
94
+ msg_pb = {
95
+ "_init_" : [["Are you", "If you", "Peanut"], [1, 1, 1]],
96
+ "Are you" : [[" asking", " wanting to"],[1, 1]],
97
+ " asking" : [[" about my", " for info on"],[1, 1]],
98
+ " for info on" : [[" Peanut Butter", " my"],[1, 1]],
99
+ " about my" : [[" cat", " pet"],[1, 1]],
100
+ " wanting to" : [[" know more about my", " eat pizza?"],[100, 1]],
101
+ "If you" : [["'re asking about", " want to know more about"],[1, 1]],
102
+ "'re asking about" : [[" my", " Peanut Butter"],[1, 1]],
103
+ " want to know more about" : [[" my", " Peanut Butter"],[1, 1]],
104
+ " know more about my" : [[" cat", " pet"],[1, 1]],
105
+ " my" : [[" cat", " pet"],[1, 1]],
106
+ " pet" : [[" cat"],[1]],
107
+ " cat" : [[" Peanut Butter"],[1]],
108
+ " Peanut Butter" : [[", then sorry. ", ", because "],[1, 1]],
109
+ ", then sorry. " : [["Peanut"],[1]],
110
+ ", because " : [["Peanut", "%j"],[5, 1]],
111
+ "%j" : [["Peanut", "%j"],[1, 8]],
112
+ "Peanut" : [[" Butter is", " Butter died."],[1, 1]],
113
+ " Butter is" : [[" no longer", " dead.", " is also an AI, like me!"],[3, 3, 1]],
114
+ " no longer" : [[" with us.", " with me.", " alive.", " allowed here. Mojang is kinda cruel."],[6, 6, 6, 1]]
115
+ }
116
+
117
+ msg_movie = {
118
+ "_init_": [["No.", "Sorry", "Nuh uh,"], [4, 2, 1]],
119
+ "No." : [[" No"],[1]],
120
+ " No" : [[" no", " no.", " no!"],[3, 1, 1]],
121
+ " no" : [[" no", " no.", " no!"],[3, 1, 1]],
122
+ " no." : [[" I am NOT", " I will NOT"],[1, 1]],
123
+ " no!" : [[" I am NOT", " I will NOT"],[1, 1]],
124
+ "Nuh uh," : [[" I am NOT", " I will NOT"],[1, 1]],
125
+ " I am NOT" : [[" going to"],[1]],
126
+ " going to" : [[" talk about"],[1]],
127
+ " I will NOT" : [[" talk about"], [1]],
128
+ " talk about" : [[" 'A Minecraft Movie'.", " the movie."],[1, 1]],
129
+ "Sorry" : [[", but I don't", " about your"],[5, 1]],
130
+ " about your" : [[" interest in", " stupid phase concerning"],[100, 1]],
131
+ " interest in" : [[" 'A Minecraft Movie'.", " the movie."],[1, 1]],
132
+ ", but I don't" : [[" feel like talking about", " want to"],[1, 1]],
133
+ " want to" : [[" talk about"],[1]],
134
+ " feel like talking about" : [[" 'A Minecraft Movie'.", " the movie."],[1, 1]]
135
+ }
136
+
137
+ def retmark(d: dict):
138
+ final = ""
139
+ cur = "_init_"
140
+ while True:
141
+ if cur in d.keys():
142
+ cur = random.choices(d[cur][0], d[cur][1])[0]
143
+ final = f"{final}{cur}"
144
+ else: break
145
+ return final
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: merl
3
- Version: 0.1.3
3
+ Version: 0.2.0
4
4
  Summary: A useless python library, aiming to emulate (not fetch/embed) the Merl experience found on the minecraft.net help page! Again, this is NOT the real Merl, but a really close copy! If you use it enough!
5
5
  Home-page: https://github.com/O9Creeps/merl
6
6
  Author: O9CreeperBoi
@@ -0,0 +1,7 @@
1
+ merl/__init__.py,sha256=z--UomdGJ1AOwNBeHlMD0uip2ehFLn8Lp_x3UP8JpHw,20
2
+ merl/merl.py,sha256=xQjmldyt9aysDcztCxlboRwiNLTXW6slKKxXeP0hsII,10026
3
+ merl/merlkov.py,sha256=O18_lnLsF1TVUsgFiRf_OJGzPnXXt3w7EwCTzo7WB0Y,7042
4
+ merl-0.2.0.dist-info/METADATA,sha256=Ti4nzkOfUPe78TF12PpKyK_ECvR9afuLOHH8agn1BX8,953
5
+ merl-0.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
6
+ merl-0.2.0.dist-info/top_level.txt,sha256=ivpualOj-EqXImlSl3Kb5GKJB1jlzFwn2anAsxaKgXA,5
7
+ merl-0.2.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,6 +0,0 @@
1
- merl/__init__.py,sha256=z--UomdGJ1AOwNBeHlMD0uip2ehFLn8Lp_x3UP8JpHw,20
2
- merl/merl.py,sha256=iNmvMAZPS6SzoZnYV6dNL3YTBSk0-M5c5L8rsWUNYj0,9841
3
- merl-0.1.3.dist-info/METADATA,sha256=KbQpxJEtQBKG9AgxTWF4R0AGYjLxq-lNMZbW9k3wlMs,953
4
- merl-0.1.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
5
- merl-0.1.3.dist-info/top_level.txt,sha256=ivpualOj-EqXImlSl3Kb5GKJB1jlzFwn2anAsxaKgXA,5
6
- merl-0.1.3.dist-info/RECORD,,