Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
import processGoldAlignment
import sys
movies = ['silence', 'shrek', 'cars', 'swordfish']
movie_folders = {'silence':'./The Silence of the Lambs (film)/processed/', 'shrek': './Shrek/processed/', 'cars':'./Cars 2/processed/', 'swordfish':'./Swordfish (film)/processed/'}
def writeLine(line, file):
file.write(line + '\n')
movie = sys.argv[1]
outputFile = open(movie + ' alignment.txt', 'w+')
script = open(movie_folders[movie] + 'script.txt', 'r')
scriptLines = script.readlines()
summary = open(movie_folders[movie] + 'wikiplot.txt', 'r')
summaryLines = summary.readlines()
cleanSummaryLines = []
for line in summaryLines:
if len(line) >= 2:
cleanSummaryLines.append(line)
goldAlignment, sentSceneMap = processGoldAlignment.processAlignment(movie_folders[movie])
print(movie)
print(goldAlignment)
print(len(sentSceneMap))
writeLine(movie, outputFile)
#try:
for i in range(len(cleanSummaryLines)):
writeLine("Summary Sentence Number: " + str(i), outputFile)
writeLine(cleanSummaryLines[i], outputFile)
if i in goldAlignment:
for sentenceNum in goldAlignment[i]:
writeLine("Scene Number: " + str(sentSceneMap[sentenceNum]), outputFile)
writeLine(scriptLines[int(sentenceNum)], outputFile)
writeLine("------------------------------------------------------------------------", outputFile)
#except:
# print("Problem")