mirror of
https://github.com/telavivmakers/geek_code.git
synced 2024-09-05 10:21:08 +03:00
Add files via upload
This commit is contained in:
parent
1d61c70086
commit
d374d1d242
38
codes.py
Normal file
38
codes.py
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
# geek_code 5.x decoder
|
||||||
|
|
||||||
|
geek_of = {
|
||||||
|
'GAI' : 'Geek of Artificial Intelligence',
|
||||||
|
'GBIO' : 'Geek of Biomedical Engineering',
|
||||||
|
'GB' : 'Geek of Business',
|
||||||
|
'GC' : 'Geek of Classics',
|
||||||
|
'GCA' : 'Geek of Commercial Arts',
|
||||||
|
'GCM' : 'Geek of Computer Management',
|
||||||
|
'GCS' : 'Geek of Computer Science',
|
||||||
|
'GCC' : 'Geek of Communications',
|
||||||
|
'GDS' : 'Geek of Data Science',
|
||||||
|
'GDVO' : 'Geek of DevOps',
|
||||||
|
'GE' : 'Geek of Engineering',
|
||||||
|
'GED' : 'Geek of Education',
|
||||||
|
'GFA' : 'Geek of Fine Arts',
|
||||||
|
'GFS' : 'Geek of Forensic Science',
|
||||||
|
'GG' : 'Geek of Government',
|
||||||
|
'GH' : 'Geek of Humanities',
|
||||||
|
'GIT' : 'Geek of Information Technology',
|
||||||
|
'GJ' : 'Geek of Jurisprudence (Law)',
|
||||||
|
'GLS' : 'Geek of Library Science',
|
||||||
|
'GL' : 'Geek of Literature',
|
||||||
|
'GMC' : 'Geek of Mass Communications',
|
||||||
|
'GM' : 'Geek of Math',
|
||||||
|
'GMD' : 'Geek of Medicine',
|
||||||
|
'GMU' : 'Geek of Music',
|
||||||
|
'GPA' : 'Geek of Performing Arts',
|
||||||
|
'GP' : 'Geek of Philosophy',
|
||||||
|
'GS' : 'Geek of Science (Physics, Chemistry, Biology, etc.)',
|
||||||
|
'GSS' : 'Geek of Social Science (Psychology, Sociology, etc.)',
|
||||||
|
'GTW' : 'Geek of Technical Writing',
|
||||||
|
'GVDD' : 'Geek of Video Game Design',
|
||||||
|
'GO' : 'Geek of Other. Some types of geeks deviate from the normal geek activities. This is encouraged as true geeks come from all walks of life.',
|
||||||
|
'GU' : 'Geek of "Undecided". This is a popular vocation with incoming freshmen.',
|
||||||
|
'G!' : 'Geek of no qualifications nor interests; likely, cannot exist',
|
||||||
|
'GAT' : 'Geek of All Trades. For those geeks that can do anything and everything. GAT usually precludes the use of other vocational descriptors.'
|
||||||
|
}
|
17
geek_decode.py
Normal file
17
geek_decode.py
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# geek_code 5.x decoder
|
||||||
|
|
||||||
|
import re
|
||||||
|
import codes
|
||||||
|
|
||||||
|
def parse_geekcode(s):
|
||||||
|
full_meaning = []
|
||||||
|
remaining_string = s
|
||||||
|
for d in [codes.geek_of]:
|
||||||
|
for code,meaning in d.items():
|
||||||
|
search_string = r'\b' + code + r'\b'
|
||||||
|
m = re.search(search_string,s)
|
||||||
|
if m:
|
||||||
|
print(f'looking for {search_string} in {remaining_string}')
|
||||||
|
remaining_string = re.sub(search_string, '', remaining_string)
|
||||||
|
full_meaning.append(meaning)
|
||||||
|
return(full_meaning, remaining_string)
|
Loading…
Reference in New Issue
Block a user