Aug-14-2017, 09:56 PM
Sweet... so... new problem... related to this...
I now have two files of different formats:
1.)"LinesfromDialogs.txt"
2.)"ShakespearsDialogs.txt"
In #1 the format is as follows-
"no no it is my fault we did not have a proper introduction
cameron
cameron
the thing is cameron i am at the mercy of a particularly hideous breed of loser my sister i cannot date until she does
the thing is cameron i am at the mercy of a particularly hideous breed of loser my sister i cannot date until she does
seems like she could get a date easy enough"
In #2, we have the following format:
"Nay, but this dotage of our general's O'erflows the measure: those his goodly eyes, That o'er the files and musters of the war Have glow'd like plated Mars, now bend, now turn, The office and devotion of their view Upon a tawny front: his captain's heart, Which in the scuffles of great fights hath burst The buckles on his breast, reneges all temper, And is become the bellows and the fan To cool a gipsy's lust. Look, where they come: Take but good note, and you shall see in him. The triple pillar of the world transform'd Into a strumpet's fool: behold and see.
If it be love indeed, tell me how much."
I am now trying to get them into the same .txt and using the same format as #2:
I now have two files of different formats:
1.)"LinesfromDialogs.txt"
2.)"ShakespearsDialogs.txt"
In #1 the format is as follows-
"no no it is my fault we did not have a proper introduction
cameron
cameron
the thing is cameron i am at the mercy of a particularly hideous breed of loser my sister i cannot date until she does
the thing is cameron i am at the mercy of a particularly hideous breed of loser my sister i cannot date until she does
seems like she could get a date easy enough"
In #2, we have the following format:
"Nay, but this dotage of our general's O'erflows the measure: those his goodly eyes, That o'er the files and musters of the war Have glow'd like plated Mars, now bend, now turn, The office and devotion of their view Upon a tawny front: his captain's heart, Which in the scuffles of great fights hath burst The buckles on his breast, reneges all temper, And is become the bellows and the fan To cool a gipsy's lust. Look, where they come: Take but good note, and you shall see in him. The triple pillar of the world transform'd Into a strumpet's fool: behold and see.
If it be love indeed, tell me how much."
I am now trying to get them into the same .txt and using the same format as #2:
f = open("/Users/Tuck/Documents/PyCharm_PythonPrograms/ChatBot_Test/srcs/trainingdata.txt", 'w') f2 = open("/Users/Tuck/Documents/PyCharm_PythonPrograms/ChatBot_Test/corpus/cornell movie-dialogs corpus/" "LinesfromDialogs.txt", 'r') f3 = open("/Users/Tuck/Documents/PyCharm_PythonPrograms/ChatBot_Test/corpus/shakespeare/ShakespearsDialogs.txt", 'r') for line in f3: f.write(line) for i, line in f2: if (i % 3 == 1): f.write(line)BUT! I keep getting the following error:
Error:Traceback (most recent call last):
File "/Users/Tuck/Documents/PyCharm_PythonPrograms/ChatBot_Test/CleanUpCorpras.py", line 19, in <module>
for i, line in f2:
ValueError: too many values to unpack
How can I fix this...?