perplexity-clone / tools /name_extractor.py
Naveen-2007's picture
Perplexity AI Clone - Full Production Version with 8 Modes
b02630d
import re
class NameExtractor:
def extract(self, text: str):
# Format: "i am naveen" , "my name is naveen"
match = re.search(r"(i am|my name is)\s+([A-Za-z]+)", text.lower())
if match:
return match.group(2).title()
return None