Skip to content

Instantly share code, notes, and snippets.

@rsalaza4
Last active March 20, 2024 18:14
Show Gist options
  • Select an option

  • Save rsalaza4/59a2764647b8fcaa2cf4911225bc8611 to your computer and use it in GitHub Desktop.

Select an option

Save rsalaza4/59a2764647b8fcaa2cf4911225bc8611 to your computer and use it in GitHub Desktop.
def get_first_name(self):
# Split resume text and store first 10 words
firstWords = self.text.split()[:10]
# Loop through the first 10 words
for word in firstWords:
# Validate that the word is not a digit and
# Validate that the character is an uppercase letter and
# Validate that the word is not "page", "last" or "updated" and
# Validate that the length of the word is greater than 1 character
if word.isdigit() == False and word[0].isupper() == True and word.lower() not in ["page", "last", "updated"] and len(word) > 1:
# Assign word to firstName
self.firstName = word
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment