-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_gematria_words.py
More file actions
42 lines (34 loc) · 1.32 KB
/
Copy pathget_gematria_words.py
File metadata and controls
42 lines (34 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/usr/bin/python
#Copyright 2020 Matteo Raso
#This file is part of Gematria.
#
# Gematria is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Gematria is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Gematria. If not, see <https://www.gnu.org/licenses/>.
#Gets every word that matches the gematria and writes it to a file.
def get_gematria_words(gematria, swear_words = False):
if swear_words:
f = open("every_word_plus_gematria.txt", 'r')
else:
f = open("every_clean_word_plus_gematria.txt", 'r')
g = open(str(gematria) + ".txt", 'w')
for line in f:
#We need a try-catch because of the copyright info.
try:
num = line.split(',')[1]
num = num.replace('\n', '')
if int(num) == gematria:
g.write(line)
except:
continue
f.close()
g.close()