Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if split[3] == "":
frequency = 0.0
else:
frequency = float(split[3])
else:
line = line.strip()
split = line.split(delimeter)
text = split[0]
frequency = float(split[1])
scansion = split[2]
if text not in data:
data[text] = []
datum = DataPoint(text, scansion, None, frequency)
data[text].append(datum)
return data
if self.constraints is None:
self.constraints = []
for constraint in constraint_violations:
self.constraints.append(constraint)
constraint_viol_count = []
for constraint in self.constraints:
constraint_viol_count.append(constraint_violations[constraint] / constraint.weight)
frequency = 0.0
for datum in data[line]:
if datum.scansion == meter_str:
frequency = datum.frequency
matched = True
data_point = DataPoint(line, meter_str, scansion_str, frequency)
data_point.violations = constraint_viol_count
parse_list.append(data_point)
full_parses[line] = parse_list
return full_parses