karlcow / shoki

shoki (書記) is a secretary in Japanese. This python program is here to help take a text only file of meeting minutes and convert it into structured data. This structured data can then be converted into other formats.
Mozilla Public License 2.0
4 stars 1 forks source link

Should parsing stop if TODO is incomplete. #3

Open karlcow opened 6 years ago

karlcow commented 6 years ago

Currently TODO is working this way

TODO: Saint-Exupéry to write Le Petit Prince 2, the sequel. 2020-04-05

but will fail if

TODO: write Le Petit Prince 2, the sequel. 2020-04-05

aka no owner and no to

Instead of breaking the parsing and the full code. We could record it as an error with a notification to fix it.

karlcow commented 6 years ago
Traceback (most recent call last):
  File "shoki.py", line 59, in <module>
    main()
  File "shoki.py", line 51, in main
    content = create(args)
  File "shoki.py", line 38, in create
    return datacore.create_minutes(**parsed_args)
  File "/Users/karl/code/shoki/shoki/datacore.py", line 43, in create_minutes
    minutes = formatter.convert(minutes_as_data(raw_text), out_format)
  File "/Users/karl/code/shoki/shoki/datacore.py", line 32, in minutes_as_data
    block['prose'])
  File "/Users/karl/code/shoki/shoki/parsing.py", line 90, in extract_prose
    voice = extract_todo(speaker, text)
  File "/Users/karl/code/shoki/shoki/parsing.py", line 133, in extract_todo
    owner, action_line = text.split(' to ', 1)
ValueError: not enough values to unpack (expected 2, got 1)

with @miketaylr action item written by thomas :) shoki really needs to be more resilient on these.

TODO: Mike, to add
miketaylr commented 6 years ago

We could record it as an error with a notification to fix it.

👍