Esempio n. 1
0
def load_users():
    x = 0
    paragraph = ''
    try:
        with open('../../Github_repos.csv', 'r') as csv_file:
            csv_reader = csv.reader(csv_file)
            for raw in csv_reader:
                list2 = []
                list2 = commit_list(raw[1], raw[2], raw[3])
                while x < 5:
                    for commit2 in list2:
                        paragraph += commit2
                        x = +1
                print(raw[0] + ': ' + check(paragraph))
    except Exception as ex:
        print(str(ex))
def individual_score():
    dict_normalized_score = OrderedDict()
    with open('../../Github_repos_SSE.csv', 'r') as csv_file:
        csv_reader = csv.reader(csv_file)

        for user2 in csv_reader:

            try:
                list2 = []
                list2 = commit_list(user2[1], user2[2], user2[3])
                statement = ''
                score = 0
                for commit2 in list2:
                    statement += commit2
                #if len(list2) >= 5:
                score = calEmotionalLevel(statement)
                dict_normalized_score.update({user2[0]: score})

                #print('Value of ' + user2[0] + ' : ' + str(score))
            except Exception as ex:
                print(ex)

    normalize(dict_normalized_score)
Esempio n. 3
0
from Github.Commit_sentiment.Sentiment import calEmotionalLevel
from Github.Github_Api.retrieve_commits import commit_list
import csv

with open('../../Github_repos.csv', 'r') as csv_file:
    csv_reader = csv.reader(csv_file)

    for user in csv_reader:
        try:
            list = []
            list = commit_list(user[1], user[2], user[3])
            score = 0
            for commit in list:
                if len(list) >= 5:
                    score += calEmotionalLevel(commit.lower())

                test = float(score) / float(len(list))
        except Exception, e:
            print e
        print 'Score of ' + user[0] + ": " + str(test)
from Github.Commit_sentiment.Sentiment import calEmotionalLevel
from Github.Github_Api.retrieve_commits import commit_list
import csv



with open('../../Github_repos.csv','r') as csv_file:
    csv_reader = csv.reader(csv_file)

    for user2 in csv_reader:

        try:
            list2 = []
            list2 = commit_list(user2[1], user2[2], user2[3])
            statement = ''
            score = 0
            for commit2 in list2:
                statement += commit2
            if len(list2) >= 5:
                score = calEmotionalLevel(statement)
            print 'Value of ' + user2[0] + ' : ' + str(score)
        except Exception, ex:
            print ex