Changes make parseInputCorpus.py compatible for both Python 2 and 3.
These changes were tested using Anaconda distributions of Python 2.7.14 and 3.6.3 on Fedora 27.
[batflyer@localhost NLP-Preprocessing]$ python parseInputCorpus.py
defaulting to block size 2
Enter the file or folder to read the corpus from: files
reading content from corpus..
Reading files from directory..
reading file d4.txt, file 1/7
reading file d2.txt, file 2/7
reading file d1.txt, file 3/7
reading file d5.txt, file 4/7
reading file d.txt, file 5/7
reading file d6.txt, file 6/7
reading file d3.txt, file 7/7
bk.txt already exists, program will generate new one, OK/Exit?:
Creating background file..
Enter Custom treeDepth?(yes/no). default treeDepth is 3:
Enter Custom nodeSize?(yes/no). default nodeSize is 3:
Enter Custom numOfClauses?(yes/no). default numOfClauses is 8:
choose target:
1.sentenceContainsTarget(+SID,+WID)
2.blockContainsTarget(+BID,+SID)
3.Both
4.new target
Enter choice: 1
writing block 1/4 to blockIDs.txt..
writing sentence 1/2 in block id 1 to sentenceIDs.txt..
writing word 1/4 from sentence id 2 in block id 1 to wordIDs.txt..
writing word 2/4 from sentence id 2 in block id 1 to wordIDs.txt..
writing word 3/4 from sentence id 2 in block id 1 to wordIDs.txt..
writing word 4/4 from sentence id 2 in block id 1 to wordIDs.txt..
writing sentence 2/2 in block id 1 to sentenceIDs.txt..
writing word 1/11 from sentence id 3 in block id 1 to wordIDs.txt..
writing word 2/11 from sentence id 3 in block id 1 to wordIDs.txt..
writing word 3/11 from sentence id 3 in block id 1 to wordIDs.txt..
writing word 4/11 from sentence id 3 in block id 1 to wordIDs.txt..
writing word 5/11 from sentence id 3 in block id 1 to wordIDs.txt..
writing word 6/11 from sentence id 3 in block id 1 to wordIDs.txt..
writing word 7/11 from sentence id 3 in block id 1 to wordIDs.txt..
writing word 8/11 from sentence id 3 in block id 1 to wordIDs.txt..
writing word 9/11 from sentence id 3 in block id 1 to wordIDs.txt..
writing word 10/11 from sentence id 3 in block id 1 to wordIDs.txt..
writing word 11/11 from sentence id 3 in block id 1 to wordIDs.txt..
writing block 2/4 to blockIDs.txt..
writing sentence 1/2 in block id 2 to sentenceIDs.txt..
writing word 1/11 from sentence id 2 in block id 2 to wordIDs.txt..
writing word 2/11 from sentence id 2 in block id 2 to wordIDs.txt..
writing word 3/11 from sentence id 2 in block id 2 to wordIDs.txt..
writing word 4/11 from sentence id 2 in block id 2 to wordIDs.txt..
writing word 5/11 from sentence id 2 in block id 2 to wordIDs.txt..
writing word 6/11 from sentence id 2 in block id 2 to wordIDs.txt..
writing word 7/11 from sentence id 2 in block id 2 to wordIDs.txt..
writing word 8/11 from sentence id 2 in block id 2 to wordIDs.txt..
writing word 9/11 from sentence id 2 in block id 2 to wordIDs.txt..
writing word 10/11 from sentence id 2 in block id 2 to wordIDs.txt..
writing word 11/11 from sentence id 2 in block id 2 to wordIDs.txt..
writing sentence 2/2 in block id 2 to sentenceIDs.txt..
writing word 1/11 from sentence id 3 in block id 2 to wordIDs.txt..
writing word 2/11 from sentence id 3 in block id 2 to wordIDs.txt..
writing word 3/11 from sentence id 3 in block id 2 to wordIDs.txt..
writing word 4/11 from sentence id 3 in block id 2 to wordIDs.txt..
writing word 5/11 from sentence id 3 in block id 2 to wordIDs.txt..
writing word 6/11 from sentence id 3 in block id 2 to wordIDs.txt..
writing word 7/11 from sentence id 3 in block id 2 to wordIDs.txt..
writing word 8/11 from sentence id 3 in block id 2 to wordIDs.txt..
writing word 9/11 from sentence id 3 in block id 2 to wordIDs.txt..
writing word 10/11 from sentence id 3 in block id 2 to wordIDs.txt..
writing word 11/11 from sentence id 3 in block id 2 to wordIDs.txt..
writing block 2/4 to blockIDs.txt..
writing sentence 1/2 in block id 3 to sentenceIDs.txt..
writing word 1/11 from sentence id 2 in block id 3 to wordIDs.txt..
writing word 2/11 from sentence id 2 in block id 3 to wordIDs.txt..
writing word 3/11 from sentence id 2 in block id 3 to wordIDs.txt..
writing word 4/11 from sentence id 2 in block id 3 to wordIDs.txt..
writing word 5/11 from sentence id 2 in block id 3 to wordIDs.txt..
writing word 6/11 from sentence id 2 in block id 3 to wordIDs.txt..
writing word 7/11 from sentence id 2 in block id 3 to wordIDs.txt..
writing word 8/11 from sentence id 2 in block id 3 to wordIDs.txt..
writing word 9/11 from sentence id 2 in block id 3 to wordIDs.txt..
writing word 10/11 from sentence id 2 in block id 3 to wordIDs.txt..
writing word 11/11 from sentence id 2 in block id 3 to wordIDs.txt..
writing sentence 2/2 in block id 3 to sentenceIDs.txt..
writing word 1/11 from sentence id 3 in block id 3 to wordIDs.txt..
writing word 2/11 from sentence id 3 in block id 3 to wordIDs.txt..
writing word 3/11 from sentence id 3 in block id 3 to wordIDs.txt..
writing word 4/11 from sentence id 3 in block id 3 to wordIDs.txt..
writing word 5/11 from sentence id 3 in block id 3 to wordIDs.txt..
writing word 6/11 from sentence id 3 in block id 3 to wordIDs.txt..
writing word 7/11 from sentence id 3 in block id 3 to wordIDs.txt..
writing word 8/11 from sentence id 3 in block id 3 to wordIDs.txt..
writing word 9/11 from sentence id 3 in block id 3 to wordIDs.txt..
writing word 10/11 from sentence id 3 in block id 3 to wordIDs.txt..
writing word 11/11 from sentence id 3 in block id 3 to wordIDs.txt..
writing block 4/4 to blockIDs.txt..
writing sentence 1/2 in block id 4 to sentenceIDs.txt..
writing word 1/11 from sentence id 2 in block id 4 to wordIDs.txt..
writing word 2/11 from sentence id 2 in block id 4 to wordIDs.txt..
writing word 3/11 from sentence id 2 in block id 4 to wordIDs.txt..
writing word 4/11 from sentence id 2 in block id 4 to wordIDs.txt..
writing word 5/11 from sentence id 2 in block id 4 to wordIDs.txt..
writing word 6/11 from sentence id 2 in block id 4 to wordIDs.txt..
writing word 7/11 from sentence id 2 in block id 4 to wordIDs.txt..
writing word 8/11 from sentence id 2 in block id 4 to wordIDs.txt..
writing word 9/11 from sentence id 2 in block id 4 to wordIDs.txt..
writing word 10/11 from sentence id 2 in block id 4 to wordIDs.txt..
writing word 11/11 from sentence id 2 in block id 4 to wordIDs.txt..
writing sentence 2/2 in block id 4 to sentenceIDs.txt..
writing word 1/8 from sentence id 3 in block id 4 to wordIDs.txt..
writing word 2/8 from sentence id 3 in block id 4 to wordIDs.txt..
writing word 3/8 from sentence id 3 in block id 4 to wordIDs.txt..
writing word 4/8 from sentence id 3 in block id 4 to wordIDs.txt..
writing word 5/8 from sentence id 3 in block id 4 to wordIDs.txt..
writing word 6/8 from sentence id 3 in block id 4 to wordIDs.txt..
writing word 7/8 from sentence id 3 in block id 4 to wordIDs.txt..
writing word 8/8 from sentence id 3 in block id 4 to wordIDs.txt..
Changes make parseInputCorpus.py compatible for both Python 2 and 3.
These changes were tested using Anaconda distributions of Python 2.7.14 and 3.6.3 on Fedora 27.