-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgetData_HI.py
28 lines (23 loc) · 973 Bytes
/
getData_HI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#########################################################################################################
# This code file is to merge all the smaller files of the transliterated data into the Devnagari script #
#########################################################################################################
import os
from string import ascii_lowercase
data_file = open('hindiData.txt','a') #file into which all the data is being merged
source = '/home/vagdevi/Documents/Honors/ABSA/ABSA_Amitavasir_data/codemix_HI_version' #location of folder containing data files
for root, dirs, filenames in os.walk(source):
for char1 in ascii_lowercase:
try:
file_series = 'x'+char1
for char2 in ascii_lowercase:
try:
file_name = file_series + char2 + '.txt'
print file_name
fullpath=os.path.join(source,file_name)
f = open(fullpath,'r')
for line in f:
data_file.write(line)
except:
pass
except:
pass