Ejemplo n.º 1
0
def main():

    # ###uncomment for resume
    resume = openFile('C:\\xampp\htdocs\CV-Parser-master\data\input\\1.json')
    print(resume)
    personA = ResumeNode("mike", '97859875', '*****@*****.**', '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)
Ejemplo n.º 2
0
def main():

    # ###uncomment for resume
    resume = openFile(
        'C:\\xampp\htdocs\CV-Parser-master\data\\input\\resume3.json')
    print(resume)
    resumeNode = ResumeNode("desmond", '97859875', '*****@*****.**', '456',
                            resume)

    ##uncomment for job desc
    content = openFile(
        'C:\\xampp\htdocs\CV-Parser-master\data\input\\jobdesc3.json')
    keywords = openFile(
        'C:\\xampp\htdocs\CV-Parser-master\data\input\keywords1.json')
    # print(resume)
    #
    jobNode = JobDescNode("545646", content, keywords)
    # print(personA.getImptKeywords())

    ResumeProcessor.construct(jobNode)
    ResumeProcessor.construct(resumeNode)

    imptKeywordSet = set(InformationNode.convertStringIntoList(keywords))
    print(imptKeywordSet)
    rskillSet = set(resumeNode.getSkills())
    jskillSet = set(jobNode.getSkills())
    resultSkillSet = rskillSet.intersection(jskillSet)
    resultSkillSet2 = rskillSet.intersection(imptKeywordSet)
    print(rskillSet)
    print(jskillSet)
    print(len(resultSkillSet) + len(resultSkillSet2))
    rLangSet = set(resumeNode.getLanguage())
    jLangSet = set(jobNode.getLanguage())
    resultLangSet = rLangSet.intersection(jLangSet)
    resultLangSet2 = rskillSet.intersection(imptKeywordSet)
    print(rLangSet)
    print(jLangSet)
    print(len(resultLangSet) + len(resultLangSet2))
    rLocationSet = resumeNode.getLocation().getCountry()
    jLocationSet = jobNode.getLocation().getCountry()
    resultLocationSet = int(rLocationSet == jLocationSet)
    print(resultLocationSet)
    print(rLocationSet)
    print(jLocationSet)

    print(resumeNode.getEducation())
    print(jobNode.getEducation())
    print(
        compareEducationBetweenJobandResume(resumeNode.getEducation(),
                                            jobNode.getEducation()))
    print(
        compareExperienceBetweenJobandResume(
            resumeNode.getExperience(), jobNode.getExperience(),
            InformationNode.convertStringIntoList(keywords)))
Ejemplo n.º 3
0
def main():

    # ###uncomment for resume
    resume = openFile('C:\\xampp\htdocs\CV-Parser-master\data\input\\1.json')
    print(resume)
    personA = ResumeNode("mike", '97859875', '*****@*****.**', '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)
Ejemplo n.º 4
0
def main():

    # ###uncomment for resume
    resume = openFile("C:\\xampp\htdocs\CV-Parser-master\data\\input\\resume3.json")
    print(resume)
    resumeNode = ResumeNode("desmond", "97859875", "*****@*****.**", "456", resume)

    ##uncomment for job desc
    content = openFile("C:\\xampp\htdocs\CV-Parser-master\data\input\\jobdesc3.json")
    keywords = openFile("C:\\xampp\htdocs\CV-Parser-master\data\input\keywords1.json")
    # print(resume)
    #
    jobNode = JobDescNode("545646", content, keywords)
    # print(personA.getImptKeywords())

    ResumeProcessor.construct(jobNode)
    ResumeProcessor.construct(resumeNode)

    imptKeywordSet = set(InformationNode.convertStringIntoList(keywords))
    print(imptKeywordSet)
    rskillSet = set(resumeNode.getSkills())
    jskillSet = set(jobNode.getSkills())
    resultSkillSet = rskillSet.intersection(jskillSet)
    resultSkillSet2 = rskillSet.intersection(imptKeywordSet)
    print(rskillSet)
    print(jskillSet)
    print(len(resultSkillSet) + len(resultSkillSet2))
    rLangSet = set(resumeNode.getLanguage())
    jLangSet = set(jobNode.getLanguage())
    resultLangSet = rLangSet.intersection(jLangSet)
    resultLangSet2 = rskillSet.intersection(imptKeywordSet)
    print(rLangSet)
    print(jLangSet)
    print(len(resultLangSet) + len(resultLangSet2))
    rLocationSet = resumeNode.getLocation().getCountry()
    jLocationSet = jobNode.getLocation().getCountry()
    resultLocationSet = int(rLocationSet == jLocationSet)
    print(resultLocationSet)
    print(rLocationSet)
    print(jLocationSet)

    print(resumeNode.getEducation())
    print(jobNode.getEducation())
    print(compareEducationBetweenJobandResume(resumeNode.getEducation(), jobNode.getEducation()))
    print(
        compareExperienceBetweenJobandResume(
            resumeNode.getExperience(), jobNode.getExperience(), InformationNode.convertStringIntoList(keywords)
        )
    )
Ejemplo n.º 5
0
    def createNewResume(self, name, hpNumber, email, contentName, content):
        con = None
        try:
            con = psycopg2.connect(
                database='d1s3idai1l2u3d',
                user='******',
                password='******',
                host='ec2-54-197-241-24.compute-1.amazonaws.com',
                port='5432',
                sslmode='require')
            cur = con.cursor()
        except psycopg2.DatabaseError as e:
            print('Error %s' % e)
            sys.exit(1)
        finally:
            if con:
                cur.execute("SELECT * FROM job")
                rows = cur.fetchall()
                numRows = (len(rows))
                newResume = ResumeNode(name, hpNumber, email, contentName,
                                       content)

                if (numRows == 0):
                    ResumeProcessor.construct(newResume)
                    toPrint = encodeClassToJson(newResume)
                    cur.execute(
                        "INSERT INTO resume VALUES (%s,%s,%s,%s,%s,%s)",
                        (toPrint, 'f', contentName, name, hpNumber, email))
                    con.commit()
                else:
                    ResumeProcessor.construct(newResume)
                    toPrint = encodeClassToJson(newResume)
                    cur.execute(
                        "INSERT INTO resume VALUES (%s,%s,%s,%s,%s,%s)",
                        (toPrint, 'f', contentName, name, hpNumber, email))
                    con.commit()
                    f = Facade()
                    matcher = Matcher(f)
                    scorer = Scorer(f)
                    matcher.matchAll(1)
                    scorer.calculateScore()
                con.close()
Ejemplo n.º 6
0
def main():
    resume = openFile('data/DesmondLim2.json')
    print(resume)
    resumeNode = ResumeNode("desmond", '97859875', '*****@*****.**', '456', resume)

    ##uncomment for job desc
    content = openFile('data/sampleJob2.json')
    print(content)
    print('1')
    keywords = openFile('data/keywords.json')
    # print(resume)
    #
    jobNode = JobDescNode("545646", content, keywords)

    arbitrary_number= 666

    match = Match(resumeNode, jobNode, arbitrary_number)
    box = MatchBox(jobNode)
    box.addMatch(match);
    boxes = set();
    boxes.add(box);
    calculateScore(boxes)
Ejemplo n.º 7
0
import json
#http://stackoverflow.com/questions/1712227/how-to-get-the-size-of-a-list
#http://stackoverflow.com/questions/20823665/python-syntaxerror-invalid-syntax-for-elif-lenorg-1

name = sys.argv[1]
hpNumber = sys.argv[2]
email = sys.argv[3]
contentName = sys.argv[4]
content = sys.argv[5]
# content = content.replace('[ ', '["')
# content = content.replace(']', '"]')

with open("1.json", encoding='utf-8') as inFile:
    contentFile = json.load(inFile)

newResume = ResumeNode(name, hpNumber, email, contentName, contentFile)
con = None
try:
    con = psycopg2.connect(database='d1s3idai1l2u3d',
                           user='******',
                           password='******',
                           host='ec2-54-197-241-24.compute-1.amazonaws.com',
                           port='5432',
                           sslmode='require')
    cur = con.cursor()
except psycopg2.DatabaseError as e:
    print('Error %s' % e)
    sys.exit(1)
finally:
    if con:
        cur.execute("SELECT * FROM job")