Dmitry Kirsanov commited on
Commit
38e5538
·
1 Parent(s): 3300976

fix parsing

Browse files
Files changed (1) hide show
  1. understand.py +5 -4
understand.py CHANGED
@@ -52,10 +52,10 @@ Give a one-paragraph summary of the document's content. Write just one paragraph
52
 
53
  for line in lines:
54
  line = line.strip()
55
- if line.strip() == "":
56
  inlist = False
57
- elif line.strip()[-1] == ":":
58
- if line.strip().upper() == what.upper():
59
  inlist = True
60
  else:
61
  inlist = False
@@ -63,7 +63,8 @@ Give a one-paragraph summary of the document's content. Write just one paragraph
63
  if line.startswith("- "):
64
  item = line[2:].strip()
65
  else:
66
- item = line.strip()
 
67
  whatlist.append(item)
68
 
69
  print(f"===Parsed list {what}: {whatlist}")
 
52
 
53
  for line in lines:
54
  line = line.strip()
55
+ if line == "":
56
  inlist = False
57
+ elif line[-1] == ":":
58
+ if line[:-1].upper() == what.upper():
59
  inlist = True
60
  else:
61
  inlist = False
 
63
  if line.startswith("- "):
64
  item = line[2:].strip()
65
  else:
66
+ item = line
67
+ print(f"---item: {item}")
68
  whatlist.append(item)
69
 
70
  print(f"===Parsed list {what}: {whatlist}")