Created
April 14, 2015 20:21
-
-
Save FrankFonts/f07cea8d560c54e359dc to your computer and use it in GitHub Desktop.
Context Aware Delimiter_030.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dict={ | |
'cap' : 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z'.split(' '), | |
'lowercase' : 'a b c d e f g h i j k l m n o p q r s t u v w x y z'.split(' ') | |
} | |
def find(this, dictionary): | |
for key in dictionary.keys(): | |
if this in dictionary[key]: | |
return key | |
def findOrGuess(this, dictionary): | |
delim = find(this, dictionary) | |
if delim == None: | |
this = this[0] | |
delim = find(this, dictionary) | |
if delim == None: | |
delim = 'H' | |
return delim | |
x = 'eogonek' | |
print findOrGuess(x, dict) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment