diff --git a/authors-tools/v1/first-name/name_gender.pickle b/authors-tools/v1/first-name/name_gender.pickle index 0a14569..fe64afe 100644 --- a/authors-tools/v1/first-name/name_gender.pickle +++ b/authors-tools/v1/first-name/name_gender.pickle Binary files differ diff --git a/authors-tools/v1/first-name/preprocessing.py b/authors-tools/v1/first-name/preprocessing.py index a319ef6..ab9240e 100644 --- a/authors-tools/v1/first-name/preprocessing.py +++ b/authors-tools/v1/first-name/preprocessing.py @@ -53,7 +53,20 @@ del my_dict[key] # supprimer la paire clé-valeur d'origine contenant le "+" return my_dict -my_dict_modified = modified_name_plus(my_dict) +def modified_name_apostrophe(my_dict) : + key_apostrophe = [] + for key in my_dict : + if "'" in key : + key_apostrophe.append(key) + for key in key_apostrophe: + value = my_dict[key] + new_key = key.replace("'", "") + my_dict[new_key] = value # ajouter une copie de la paire clé-valeur sans le "+" à la fin du dictionnaire + del my_dict[key] # supprimer la paire clé-valeur d'origine contenant le "+" + return my_dict + +my_dict_1 = modified_name_plus(my_dict) +my_dict_modified = modified_name_apostrophe(my_dict_1) # print(my_dict_modified) with open('name_gender.pickle', 'wb') as handle: