-
Notifications
You must be signed in to change notification settings - Fork 2
/
gemGram666.py
33 lines (26 loc) · 1013 Bytes
/
gemGram666.py
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
from typing import List
from gemNumFuncs import getGematria
import getwordsfromdbs as gwdb
import pyphen
import sys
def generate_identical_gematria_words(original_words: List[str], syllables: List[str]):
def calculate_gematria(word):
return getGematria(word, "ScaExt")
identical_gematria_words = []
for word in original_words:
original_gematria = calculate_gematria(word)
for syllable in syllables:
if calculate_gematria(syllable) == original_gematria:
identical_gematria_words.append(syllable)
break
ret=""
for word in identical_gematria_words:
ret += word+" "+str(getGematria(word, "ScaExt"))+" "
return ret
def extract_syllables(words):
dic = pyphen.Pyphen(lang='en_US')
syllables=[]
for word in words:
syllables += dic.inserted(word.lower()).split('-')
return syllables
print(generate_identical_gematria_words(sys.argv[1].split(), extract_syllables(gwdb.getDeepMem())))