hylee719 commited on
Commit
030dc40
·
1 Parent(s): aa5e09a

add debugging print statements

Browse files
Files changed (1) hide show
  1. handler.py +3 -0
handler.py CHANGED
@@ -379,6 +379,7 @@ def run_math_density(transcript, uptake_speaker=None):
379
  match_list = []
380
  for term in sorted_terms:
381
  matches = list(re.finditer(term, text, re.IGNORECASE))
 
382
  # Filter out matches that share positions with longer terms
383
  matches = [match for match in matches if not any(match.start() in range(existing[0], existing[1]) for existing in matched_positions)]
384
  if len(matches) > 0:
@@ -389,6 +390,8 @@ def run_math_density(transcript, uptake_speaker=None):
389
  # Update matched positions
390
  matched_positions.update((match.start(), match.end()) for match in matches)
391
  num_matches += len(matches)
 
 
392
  utt.num_math_terms = num_matches
393
  utt.math_terms = match_list
394
  dict_list = []
 
379
  match_list = []
380
  for term in sorted_terms:
381
  matches = list(re.finditer(term, text, re.IGNORECASE))
382
+ print("math term matches: ", matches)
383
  # Filter out matches that share positions with longer terms
384
  matches = [match for match in matches if not any(match.start() in range(existing[0], existing[1]) for existing in matched_positions)]
385
  if len(matches) > 0:
 
390
  # Update matched positions
391
  matched_positions.update((match.start(), match.end()) for match in matches)
392
  num_matches += len(matches)
393
+ print("num matches: ", num_matches)
394
+ print("math terms: ", match_list)
395
  utt.num_math_terms = num_matches
396
  utt.math_terms = match_list
397
  dict_list = []