summaryrefslogtreecommitdiff
path: root/import-misskey.py
diff options
context:
space:
mode:
Diffstat (limited to 'import-misskey.py')
-rw-r--r--import-misskey.py27
1 files changed, 12 insertions, 15 deletions
diff --git a/import-misskey.py b/import-misskey.py
index 29b63bb..e5acfd3 100644
--- a/import-misskey.py
+++ b/import-misskey.py
@@ -43,27 +43,24 @@ for note in export_json:
text = re.sub(HTML, '', text)
text = re.sub(SPACE, ' ', text)
text = re.sub(CONTRACTION, r'\1\2', text)
- if(config__.emojis == False):
- text = re.sub(EMOJI, '', text)
text = text.strip()
print(f" - {text}")
corpus.append(text)
- if(config__.emojis == True):
- noteemojis = EMOJI.findall(text)
- if(noteemojis):
- emojis = emojis + noteemojis
+ noteemojis = EMOJI.findall(text)
+ if(noteemojis):
+ emojis = emojis + noteemojis
-if(config__.emojis == True):
- print('[+] preserving emojis:')
- emojis = list(set(emojis))
- s_emo = []
- for emo in emojis:
- s_emo.append(emo.replace(":", ""))
- print(s_emo)
- with open("emojis.json", "w") as f:
- json.dump(s_emo, f)
+
+print('[+] preserving emojis:')
+emojis = list(set(emojis))
+s_emo = []
+for emo in emojis:
+ s_emo.append(emo.replace(":", ""))
+print(s_emo)
+with open("emojis.json", "w") as f:
+ json.dump(s_emo, f)
print('[+] building markov chain')
model = chain.Text("@@note@@".join(corpus), well_formed=False)