-
Notifications
You must be signed in to change notification settings - Fork 0
/
garytest2.py
83 lines (68 loc) · 2.66 KB
/
garytest2.py
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
__author__ = 'Owner'
from nltk import word_tokenize
import json, re
import jsonpickle
from InformationNode import InformationNode
from ResumeNode import ResumeNode
from JobDescNode import JobDescNode
from FieldsIndexNode import FieldsIndexNode
from EducationParser import EducationParser
from SkillsParser import SkillsParser
from ExperienceParser import ExperienceParser
from FieldLocator import FieldLocator
from ParserFactory import ParserFactory
from ResumeProcessor import ResumeProcessor
import CustomClassJson
def saveFile(fileLocation, tempList, keyword):
fileName = ''.join((fileLocation, keyword, '.json'))
with open(fileName, 'w') as outfile:
json.dump(tempList, outfile, indent=1, ensure_ascii=False)
print('saved')
def openFile(eFile):
with open(eFile, encoding='utf-8') as inFile:
return json.load(inFile)
def test(node):
node.setName('john')
def main():
# ###uncomment for resume
resume = openFile('C:\\xampp\htdocs\CV-Parser-master\data\input\\1.json')
print(resume)
personA = ResumeNode("mike", '97859875', 'desmond@gmail.com', '456', resume)
##uncomment for job desc
# resume = openFile('C:\\xampp\htdocs\CV-Parser-master\data\input\\jobdesc3.json')
# keywords = openFile('C:\\xampp\htdocs\CV-Parser-master\data\\keywords.json')
#print(resume)
# personA = JobDescNode("545646", resume, keywords)
# print(personA.getImptKeywords())
ResumeProcessor.construct(personA)
print("----- SKILLS -----")
print(personA.getSkills())
print("----- Education -----")
print(personA.getEducation())
print("----- Language -----")
print(personA.getLanguage())
print("----- Experience -----")
print(personA.getExperience())
for i in personA.getExperience():
print(i.workPositionOrExp)
print(i.workDuration)
print("----- Location -----")
print(personA.getLocation())
print(personA.getLocation().getAddress())
print(personA.getLocation().getCountry())
print(personA.getLocation().getCity())
#### FOR PRINTING OUT THE LINES IN CONTENT
# for i, j in enumerate(InformationNode.convertStringIntoList(personA.getContent())):
# print('------------------------------- ',i)
# print(j)
# temp = CustomClassJson.encodeClassToJson(personA)
# with open('sampleJob2.json', 'w') as outfile:
# json.dump(temp, outfile)
tester1 = CustomClassJson.encodeClassToJson(personA)
print(tester1)
# tester = openFile("D:\install location\pycharm\python\\nltkProj\qy\sampleJob2.json")
# print(tester)
# blah = CustomClassJson.decodeJsonToClass(tester)
# print(blah.getEducation())
if __name__ == "__main__":
main()