Created
July 5, 2018 04:47
-
-
Save nkuln/e7e7a49df11c9654273c221e01a0b0c8 to your computer and use it in GitHub Desktop.
Overly simplistic classifier
This file contains hidden or 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
def is_male(name): | |
if u"ศักดิ์" in name or name.endswith(u"วุฒิ"): | |
return True | |
elif name.endswith(u"พร") or name.endswith(u"พรรณ"): | |
return False | |
else: | |
return False | |
print(is_male(u"ณัฐวุฒิ")) # True | |
print(is_male(u"ณัฏฐ์พร")) # False |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment