File size: 473 Bytes
b06ff0c |
1 2 3 4 5 6 7 8 9 10 11 12 |
import re
def FindKeyWords(keywords, text):
highlighted_text = text
for keyword in keywords:
if re.search(r'\b({0})\b'.format(re.escape(keyword)), highlighted_text, flags=re.IGNORECASE):
highlighted_text = re.sub(r'\b({0})\b'.format(re.escape(keyword)), r'<mark style="background-color: yellow;">\1</mark>', highlighted_text, flags=re.IGNORECASE)
else:
return "Keyword not found in the Resume."
return highlighted_text
|