Skip to content

Commit

Permalink
update generate.py
Browse files Browse the repository at this point in the history
  • Loading branch information
epico committed Apr 18, 2013
1 parent 632e0ed commit 7dda575
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
def generateOneText(infile, modelfile, reportfile):
infilestatuspath = infile + config.getStatusPostfix()
infilestatus = utils.load_status(infilestatuspath)
if not utils.check_epoch(infilestatus, 'Segment'):
raise utils.EpochError('Please segment first.\n')
if not utils.check_epoch(infilestatus, 'MergeSequence'):
raise utils.EpochError('Please mergeseq first.\n')
if utils.check_epoch(infilestatus, 'Generate'):
return False

Expand All @@ -34,7 +34,7 @@ def generateOneText(infile, modelfile, reportfile):
str(config.getMaximumIncreaseRatesAllowed()), \
'--k-mixture-model-file', \
modelfile, infile + \
config.getSegmentPostfix()]
config.getMergedPostfix()]
subprocess = Popen(cmdline, shell=False, stderr=PIPE, \
close_fds=True)

Expand Down Expand Up @@ -106,8 +106,8 @@ def storeModelStatus(modelfile, textnum, nexttextnum):

indexstatuspath = indexpath + config.getStatusPostfix()
indexstatus = utils.load_status(indexstatuspath)
if not utils.check_epoch(indexstatus, 'Segment'):
raise utils.EpochError('Please segment first.\n')
if not utils.check_epoch(indexstatus, 'MergeSequence'):
raise utils.EpochError('Please mergeseq first.\n')
if utils.check_epoch(indexstatus, 'Generate'):
return

Expand Down Expand Up @@ -135,7 +135,7 @@ def storeModelStatus(modelfile, textnum, nexttextnum):
oneline = oneline.rstrip(os.linesep)
(title, textpath) = oneline.split('#')
infile = config.getTextDir() + textpath
infilesize = utils.get_file_length(infile + config.getSegmentPostfix())
infilesize = utils.get_file_length(infile + config.getMergedPostfix())
if infilesize < config.getMinimumFileSize():
print("Skipping " + title + '#' + textpath)
continue
Expand Down

0 comments on commit 7dda575

Please sign in to comment.