@@ -30,65 +30,53 @@ def exists(self):
30
30
def extract (self ):
31
31
# add functions to convert other formats to text
32
32
if self .path .find (".pdf" ) != - 1 :
33
- self .resume_text = converter .pdf_to_txt (self .path )
33
+ self .raw_text = converter .pdf_to_txt (self .path )
34
34
35
- if self .resume_text is not '' :
36
- self .parse ()
35
+ if self .raw_text is not '' :
36
+ self .parse ()
37
+ else :
38
+ raise ValueError ("Error parsing resume." )
37
39
38
40
def parse (self ):
39
41
self .URLs = annotations_parser .fetch_pdf_urls (self .path )
40
- self .email = details_parser .fetch_email (self .resume_text )
41
- self .phone_numbers = details_parser .fetch_phone (self .resume_text )
42
- self .address = details_parser .fetch_address (self .resume_text )
43
- self .experience = details_parser .calculate_experience (self .resume_text )
44
- self .cleaned_resume = language_parser .clean_resume (self .resume_text )
42
+ self .emails = details_parser .fetch_email (self .raw_text )
43
+ self .phone_numbers = details_parser .fetch_phone (self .raw_text )
44
+ self .address = details_parser .fetch_address (self .raw_text )
45
+ self .experience = details_parser .calculate_experience (self .raw_text )
46
+ self .skills = language_parser .clean_resume (self .raw_text )
45
47
46
48
# TODO: Add more fetch here
47
49
def show (self ):
48
- print '==================================================================='
49
- print '\n File path:'
50
- print '-------------------------------------------------------------------'
51
- print self .path
52
- print '==================================================================='
53
- print '\n Resume Text'
54
- print '-------------------------------------------------------------------'
55
- print self .resume_text
56
- print '==================================================================='
57
- print '\n URLs'
58
- print '-------------------------------------------------------------------'
59
- print self .URLs
60
- print '==================================================================='
61
- print '\n Phone numbers'
62
- print '-------------------------------------------------------------------'
63
- print self .phone_numbers
64
- print '==================================================================='
65
- print '\n Emails'
66
- print '-------------------------------------------------------------------'
67
- print self .email
68
- print '==================================================================='
69
- print '\n Address'
70
- print '-------------------------------------------------------------------'
71
- print self .address
72
- print '==================================================================='
73
- print '\n Experience'
74
- print '-------------------------------------------------------------------'
75
- print str (self .experience ) + " years"
76
- print '==================================================================='
77
- print '\n Skills'
78
- print '-------------------------------------------------------------------'
79
- print self .cleaned_resume
80
- print '==================================================================='
81
- print '-------------------------------------------------------------------'
82
- print '==================================================================='
83
-
84
- # def main():
85
- # # Will be made interactive at a later point of the development.
86
- # resume_name = raw_input('Enter Resume name to use:')
87
- # # resume_name = 'lakshmanaram'
88
- # file_name = DIRPATH + '/data/input/'+resume_name+'.pdf'
89
- # print(file_name)
90
- # resume = Cvscan(file_name)
91
- # resume.show_raw_details()
92
- #
93
- # if __name__ == "__main__":
94
- # main()
50
+ return {
51
+ "experience" : self .experience ,
52
+ "address" : self .address ,
53
+ "phone_numbers" : self .phone_numbers ,
54
+ "emails" : self .emails ,
55
+ "urls" : self .URLs ,
56
+ "skills" : self .skills
57
+ }
58
+ # print '==================================================================='
59
+ # print '\nURLs'
60
+ # print '-------------------------------------------------------------------'
61
+ # print self.URLs
62
+ # print '==================================================================='
63
+ # print '\nPhone numbers'
64
+ # print '-------------------------------------------------------------------'
65
+ # print self.phone_numbers
66
+ # print '==================================================================='
67
+ # print '\nEmails'
68
+ # print '-------------------------------------------------------------------'
69
+ # print self.email
70
+ # print '==================================================================='
71
+ # print '\nAddress'
72
+ # print '-------------------------------------------------------------------'
73
+ # print self.address
74
+ # print '==================================================================='
75
+ # print '\nExperience'
76
+ # print '-------------------------------------------------------------------'
77
+ # print str(self.experience) + " years"
78
+ # print '==================================================================='
79
+ # print '\nSkills'
80
+ # print '-------------------------------------------------------------------'
81
+ # print self.skills
82
+ # print '==================================================================='
0 commit comments