File size: 521 Bytes
158b61b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from mosestokenizer import *

input_paras = open("ed-tech/WARANGAL-FORT-FINAL.txt", "r").readlines()

output = []
for para in input_paras:
    if len(para.strip("\n")) > 0:
        with MosesSentenceSplitter('en') as splitsents:
            out_temp = splitsents([para.strip("\n").strip()])
            for i in out_temp:
                output.append(i)
output_sents = open("ed-tech/warangal-fort-final-sents.txt", "w+")

for line in output:
    output_sents.write(line.strip("\n").strip() + "\n")

output_sents.close()