Exemple #1
0
 def createNewJob(self, contentName, contentID, keyword, 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 resume");
             rows = cur.fetchall()
             numRows = (len(rows))
             newJob = JobDescNode(contentID, keyword, content)
             if (numRows == 0):
                 ResumeProcessor.construct(newJob)
                 toPrint = encodeClassToJson(newJob)
                 cur.execute("INSERT INTO job VALUES (%s,%s,%s,%s)",(toPrint,'f', contentID ,contentName))
                 con.commit()
             else:
                 ResumeProcessor.construct(newJob)
                 toPrint = encodeClassToJson(newJob)
                 cur.execute("INSERT INTO job VALUES (%s,%s,%s,%s)",(toPrint,'f', contentID ,contentName))
                 con.commit()
                 f = Facade()
                 matcher = Matcher(f)
                 scorer = Scorer(f)
                 matcher.matchAll(2)
                 scorer.calculateScore()
             con.close()
Exemple #2
0
 def process(self, resume, job, keyword):
     resumeNode = ResumeNode("name", "999", "*****@*****.**", "0", resume)
     jobNode = JobDescNode("0", job, keyword)
     ResumeProcessor.construct(resumeNode)
     ResumeProcessor.construct(jobNode)
     self.facade.storeJob(jobNode)
     self.facade.storeResume(resumeNode)
     self.matcher.matchAll(0)
Exemple #3
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)))
Exemple #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)
        )
    )
Exemple #5
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)
Exemple #6
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)
Exemple #7
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()
Exemple #8
0
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 resume");
        rows = cur.fetchall()
        numRows = (len(rows))
        newJob = JobDescNode(contentID, contentFile, keyword)
        if (numRows == 0):
            ResumeProcessor.construct(newJob)
            toPrint = encodeClassToJson(newJob)
            cur.execute("INSERT INTO job VALUES (%s,%s,%s,%s)",(toPrint,'f', contentID ,contentName))
            con.commit()
            print('just store job')
        else:
            ResumeProcessor.construct(newJob)
            toPrint = encodeClassToJson(newJob)
            cur.execute("INSERT INTO job VALUES (%s,%s,%s,%s)",(toPrint,'f', contentID ,contentName))
            con.commit()
            f = Facade()
            matcher = Matcher(f)
            scorer = Scorer(f)
            cur.execute("SELECT isonce_resume FROM once")
            rows = cur.fetchall()
            for row in rows:
Exemple #9
0
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");
            rows = cur.fetchall()
            numRows = (len(rows))

            if (numRows == 0):
                ResumeProcessor.construct(newResume)
                toPrint = encodeClassToJson(newResume)
                #print(type(newResume.getContent()))
                print(toPrint)
                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)
                #print(type(newResume.getContent()))
                print(toPrint)
                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)
Exemple #10
0
                           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))

        if (numRows == 0):
            ResumeProcessor.construct(newResume)
            toPrint = encodeClassToJson(newResume)
            #print(type(newResume.getContent()))
            print(toPrint)
            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)
            #print(type(newResume.getContent()))
            print(toPrint)
            cur.execute("INSERT INTO resume VALUES (%s,%s,%s,%s,%s,%s)",
                        (toPrint, 'f', contentName, name, hpNumber, email))
            con.commit()
            f = Facade()