Skip to content
Permalink
9bee05cdcc
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
26 lines (24 sloc) 883 Bytes
class ScriptSentenceMapExtractor:
def __init__(self):
self.scene_Sentence_Map = open("sceneSentenceMap.txt", "r")
self.sceneMap = []
self.sceneCount = 0
self.sentenceMap = dict()
def extractSentenceMap(self):
for line in self.scene_Sentence_Map:
mapLine = line.split(",")
scene = mapLine[0].split("\t")
scene = scene[0]
mapLine[0] = mapLine[0][len(scene):]
for i in range(0, len(mapLine) ):
mapLine[i] = mapLine[i].replace("[","")
mapLine[i] = mapLine[i].replace("\t","")
mapLine[i] = mapLine[i].replace(" ", "")
mapLine[i] = mapLine[i].replace("]", "")
mapLine[i] = mapLine[i].replace("\n", "")
self.sceneMap.append(mapLine)
self.sceneCount = self.sceneCount + 1
for sceneNumber in range(self.sceneCount):
for sentence in self.sceneMap[sceneNumber]:
self.sentenceMap[sentence] = sceneNumber
return self.sentenceMap