in ocr/utils/sclite_helper.py [0:0]
def __init__(self, sclite_location=os.path.join("..", "SCTK", "bin"),
tmp_file_location="tmp", use_uuid=True):
# Check if sclite exists
assert os.path.isdir(sclite_location), "{} does not exist".format(sclite_location)
sclite_error = "{} doesn't contain sclite".format(sclite_location)
retries = 10
for i in range(retries):
if self._test_sclite(sclite_location):
break
elif i == retries-1:
raise sclite_error
self.sclite_location = sclite_location
if use_uuid:
tmp_file_location += "/" + str(uuid.uuid4())
# Check if tmp_file_location exists
if not os.path.isdir(tmp_file_location):
os.makedirs(tmp_file_location)
self.tmp_file_location = tmp_file_location
self.predicted_text = []
self.actual_text = []