openeventdata / UniversalPetrarch

Language-agnostic political event coding using universal dependencies
MIT License
18 stars 9 forks source link

Error when using null actor/verb codes #14

Open ahalterman opened 6 years ago

ahalterman commented 6 years ago

I'm trying to run Universal Petrarch with the null_actors and null_verbs options and ran into an error. Here's the traceback:

Traceback (most recent call last):
  File "tests/test_petrarch.py", line 147, in <module>
    test_petr_formatted_to_results()
  File "tests/test_petrarch.py", line 142, in test_petr_formatted_to_results
    parsed=True)
  File "/Users/ahalterman/MIT/NSF_RIDIR/UniversalPetrarch/UniversalPetrarch/petrarch_ud.py", line 428, in run_pipeline
    read_dictionaries()
  File "/Users/ahalterman/MIT/NSF_RIDIR/UniversalPetrarch/UniversalPetrarch/petrarch_ud.py", line 158, in read_dictionaries
    PETRreader.read_actor_dictionary(actor_path)
  File "/Users/ahalterman/MIT/NSF_RIDIR/UniversalPetrarch/UniversalPetrarch/PETRreader.py", line 1989, in read_actor_dictionary
    actordict["#"].extend(check_date_boundaries(datelist))
  File "/Users/ahalterman/MIT/NSF_RIDIR/UniversalPetrarch/UniversalPetrarch/PETRreader.py", line 1901, in check_date_boundaries
    if not item[1]: #actor code without time restriction
IndexError: list index out of range

I get the error when I run this file in my fork of UniversalPetrarch.

Here's the config file I'm using: PETR_config.txt

JingL1014 commented 6 years ago

i added the run_pipeline() in the petrarch_ud.py. I didn't run in errors when running the file in your fork. But i still need to implement the functions with null_actors and null_verbs options in UDpetrarch as in petrarch2.