Last active
March 20, 2024 18:14
-
-
Save rsalaza4/59a2764647b8fcaa2cf4911225bc8611 to your computer and use it in GitHub Desktop.
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 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