Skip to content

Commit 8f20bfc

Browse files
committed
merged
1 parent 3d748b9 commit 8f20bfc

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ def verifier_texte_dechiffre(texte: str) -> Dict[str, Any]:
101101
copy=texte
102102
for lettre in tab:
103103
copy=copy.replace(lettre, ' ')
104-
mots = [mot.removesuffix('\n').removeprefix('\n') for mot in copy.strip().split(' ') if mot != '\n']
104+
105+
# Diviser par espaces et filtrer les mots vides
106+
mots = [mot.strip() for mot in copy.split(' ') if mot.strip()]
105107
stats['nombre_mots']=len(mots)
106108

107109
# Verifier que le chaque mot du texte est un mot anglais/francais
@@ -191,3 +193,5 @@ def rangerDico() -> None:
191193
except FileNotFoundError:
192194
print('Fichier non trouvé.')
193195
# rangerDico()
196+
197+
print(verifier_texte_dechiffre("je talk !a mamamia:?\n"))

tests/fichiers_pour_tests/aes_gcm_invalide.enc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
g��6o@�AB�L��H�������]�W����Yhm��<�+��&?�M# �(iv�k��! w4N<D�����"#�E���W
1+
�� �����h7�U�(��|6rIӓMֶ��}7~|/8�gZ,�X�ȯ�����*��#���v�U��̴��3;���]��� ��

0 commit comments

Comments
 (0)