Carlos-Francisco Méndez-Cruz

Prepare abstracts

...@@ -20,7 +20,7 @@ __author__ = 'CMendezC' ...@@ -20,7 +20,7 @@ __author__ = 'CMendezC'
20 # Execution: 20 # Execution:
21 # python3 prepare-abstracts.py 21 # python3 prepare-abstracts.py
22 # --inputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets 22 # --inputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets
23 -# --inputFile text-annotated-abstracts-original.txt 23 +# --inputFile text-annotated-abstracts.txt
24 # --outputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets/original 24 # --outputPath /export/space1/users/compu2/bionlp/conditional-random-fields/data-sets/original
25 # --dicPath /export/space1/users/compu2/bionlp/nlp-preprocessing-pipeline/dictionaries 25 # --dicPath /export/space1/users/compu2/bionlp/nlp-preprocessing-pipeline/dictionaries
26 # --dicFile genes.txt 26 # --dicFile genes.txt
...@@ -64,7 +64,7 @@ if __name__ == "__main__": ...@@ -64,7 +64,7 @@ if __name__ == "__main__":
64 with open(os.path.join(options.inputPath, options.inputFile), "r", encoding="utf-8", errors="replace") as iFile: 64 with open(os.path.join(options.inputPath, options.inputFile), "r", encoding="utf-8", errors="replace") as iFile:
65 print("Reading file..." + options.inputFile) 65 print("Reading file..." + options.inputFile)
66 for line in iFile: 66 for line in iFile:
67 - line = line.strip('\n') 67 + line = line.strip('\r\n')
68 for gene in reGene.findall(line): 68 for gene in reGene.findall(line):
69 # print("genes: {}".format(gene)) 69 # print("genes: {}".format(gene))
70 if gene not in hashGenes: 70 if gene not in hashGenes:
......