-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_current_parser.py
More file actions
42 lines (35 loc) · 1.56 KB
/
debug_current_parser.py
File metadata and controls
42 lines (35 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import sys
import os
sys.path.append(os.path.dirname(os.path.abspath(__file__)))
from app.services.intelligent_parser import IntelligentResumeParser
def check_parser_state():
parser = IntelligentResumeParser()
# Check if the problematic phrase is in the non_technical_words set
non_technical_words = getattr(parser, '_non_technical_words', set())
if hasattr(parser, '_is_likely_skill'):
# Get the non_technical_words from the method
import inspect
source = inspect.getsource(parser._is_likely_skill)
print("_is_likely_skill method source:")
print(source)
print("\n" + "="*50 + "\n")
# Test the skills filtering directly
test_phrase = "participated in requirement analysis and technical design discussions"
result = parser._is_likely_skill(test_phrase)
print(f"Testing phrase: '{test_phrase}'")
print(f"Result: {result}")
# Test company extraction
test_header = "Senior Software Engineer - TechCorp - January 2023 - Present"
print(f"\nTesting company extraction with: '{test_header}'")
# Check the regex pattern in the method
import re
pattern = r'^(.+?)\s+[-–—]\s+([^-–—|]+?)(?:\s*[-–—]\s*|\s*\|.*|$)'
match = re.search(pattern, test_header, re.IGNORECASE)
if match:
print(f"Pattern match: {match.groups()}")
company = match.group(2).strip()
print(f"Extracted company: '{company}'")
else:
print("No pattern match")
if __name__ == "__main__":
check_parser_state()