Files
ola5doc/output/sources/pyt8.py
T

47 lines
1.1 KiB
Python

#!/usr/bin/env python
# -*- coding: utf-8 -*-
# this programme compare a text in french and its translation in englishe and liste the common words .
with open("JVFR.txt", "r") as textFr:
for line in textFr:
line=line.strip()
mots=line.split()
#for mot in mots :
#print(mot)
with open("JVEN.txt", "r") as textEn:
for line in textEn:
line=line.strip()
words=line.split()
for word in words :
print(word)
nb=0
for word in words:
word = word.strip(" ;''?:,()!.\").”-")
for mot in mots:
#mot = mot.strip(" ;''?:,()!.\").”-")
if word == mot :
nb= nb+1
print(word)
print("nombres des mots anglais identiques =" , nb)
with open("JVES.txt", "r") as textEs:
for line in textEs:
line=line.strip()
palabs=line.split()
#for palab in palabs :
#print(palab)
nbr=0
for palab in palabs:
palab = palab.strip(" ;''?:,()!.\").”-")
for mot in mots:
#mot = mot.strip(" ;''?:,()!.\").”-")
if palab == mot :
nbr= nbr+1
print(word)
print("nombres des mots espagnole identiques =" , nbr)