Skip to content

Instantly share code, notes, and snippets.

@nkuln
Created July 5, 2018 04:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nkuln/e7e7a49df11c9654273c221e01a0b0c8 to your computer and use it in GitHub Desktop.
Save nkuln/e7e7a49df11c9654273c221e01a0b0c8 to your computer and use it in GitHub Desktop.
Overly simplistic classifier
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