openeventdata / UniversalPetrarch

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

Print out dictionary line number on match #48

Closed ahalterman closed 5 years ago

ahalterman commented 5 years ago

(We've been talking about this for a while but wanted to consolidate as an issue @khaledJabr @philip-schrodt ).

Petrarch1 and Petrarch2 both had the ability to print out the dictionary line number of a match. This is very useful for debugging the dictionaries, since otherwise we don't know what pattern resulted in a coding. UniversalPetrarch does not have this ability and needs it so we can debug dictionaries.

khaledJabr commented 5 years ago

Here's the original issue for this https://github.com/openeventdata/UniversalPetrarch/issues/40 @JingL1014 already made a suggestion to do something similar, but it is not quite the same thing as we're looking for.

JingL1014 commented 5 years ago

The line number information is added and is stored in the data structure for dictionary. For example: {'*': {'RESOLUTION': {'#': {'code': '057', 'line': '- * RESOLUTION [057] # tony 4/22/91 line:330'}}

In the output event file, the line number is printed as well. For example: 20080806 ISR PSE 0841 AFP0808020857_2 AFP PALESTINIAN - * PRISONERS [0841] # RELEASE line:6884

ahalterman commented 5 years ago

It sounds like this is resolved now. Is that right? If so, we should close.

JingL1014 commented 5 years ago

Yes. This is solved.