mirror of
https://github.com/telavivmakers/geek_code.git
synced 2024-09-05 10:21:08 +03:00
Merge branch 'master' of https://github.com/exarobibliologist/geek_code
This commit is contained in:
commit
fe7ed8cd4a
0
code/__init__
Normal file
0
code/__init__
Normal file
38
code/codes.py
Normal file
38
code/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
code/geek_decode.py
Normal file
17
code/geek_decode.py
Normal file
|
@ -0,0 +1,17 @@
|
|||
# geek_code 5.x decoder
|
||||
|
||||
import re
|
||||
from codes import *
|
||||
|
||||
def parse_geekcode(s):
|
||||
full_meaning = []
|
||||
remaining_string = s
|
||||
for d in [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'found {search_string} in {remaining_string}')
|
||||
remaining_string = re.sub(search_string, '', remaining_string)
|
||||
full_meaning.append(meaning)
|
||||
return(full_meaning, remaining_string)
|
4
code/test.py
Normal file
4
code/test.py
Normal file
|
@ -0,0 +1,4 @@
|
|||
import geek_decode
|
||||
|
||||
meaning,remaining = geek_decode.parse_geekcode(' GS blabla GDS')
|
||||
print(meaning, remaining)
|
Loading…
Reference in New Issue
Block a user