openeventdata / UniversalPetrarch

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

Crash on EXPECT/ * (IN) (FOR TALK) #29

Closed philip-schrodt closed 6 years ago

philip-schrodt commented 6 years ago

System crashes at

File "/UniversalPetrarch/PETRgraph.py", line 1544, in get_verb_code lowermatch = match_lower(patternDictPath, verb, target) File "/UniversalPetrarch/PETRgraph.py", line 1424, in match_lower temptargetmatch = match_noun(path, np) File "/UniversalPetrarch/PETRgraph.py", line 1250, in match_noun match = reroute(subpath,lambda a: match_noun(a, pp_np), match_prep) File "/UniversalPetrarch/PETRgraph.py", line 1376, in reroute match = o3(subpath['|']) TypeError: match_prep() takes exactly 2 arguments (1 given)

on these two records. Comment out that pattern and it runs okay on these: guessing it probably has something to do with the double () () construction.

<P1Event [['JAM', 'ZWE', '036']]>
<P2Event [['ZWE', 'JAM', '030']]>
<Text>
Jamaican international artiste Charly Black is expected in Harare today in the afternoon for a once-
off performance on Saturday at Longcheng Plaza .
</Text>
<Parse>
1   Jamaican    jamaican    ADJ JJ  Degree=Pos  5   amod    _   _
2   international   international   ADJ JJ  Degree=Pos  3   amod    _   _
3   artiste artiste NOUN    NN  Number=Sing 5   compound    _   _
4   Charly  Charly  PROPN   NNP Number=Sing 5   compound    _   _
5   Black   black   PROPN   NNP Number=Sing 7   nsubj:pass  _   _
6   is  be  AUX VBZ Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin   7   aux:pass    _   _
7   expected    expect  VERB    VBN Tense=Past|VerbForm=Part|Voice=Pass 0   root    _   _
8   in  in  ADP IN  _   9   case    _   _
9   Harare  Harare  PROPN   NNP Number=Sing 7   obl _   _
10  today   today   NOUN    NN  Number=Sing 7   obl:tmod    _   _
11  in  in  ADP IN  _   13  case    _   _
12  the the DET DT  Definite=Def|PronType=Art   13  det _   _
13  afternoon   afternoon   NOUN    NN  Number=Sing 7   obl _   _
14  for for ADP IN  _   17  case    _   _
15  a   a   DET DT  Definite=Ind|PronType=Art   17  det _   _
16  once-off    once-off    ADJ JJ  Degree=Pos  17  amod    _   _
17  performance performance NOUN    NN  Number=Sing 19  obl _   _
18  on  on  ADP IN  _   19  case    _   _
19  Saturday    Saturday    PROPN   NNP Number=Sing 7   obl _   _
20  at  at  ADP IN  _   22  case    _   _
21  Longcheng   Longcheng   PROPN   NNP Number=Sing 22  compound    _   _
22  Plaza   Plaza   PROPN   NNP Number=Sing 19  nmod    _   _
23  .   .   PUNCT   .   _   7   punct   _   _
</Parse></Sentence>
<Sentence date="20150709" id="2f33473f-0587-4863-bc99-2993f4e68b8b_2" category="COMPARE" evaluate="true">
<P1Event [['NGAELIGOV', 'USA', '010']]>
<P2Event [['USA', 'NGAELI', '030']]>
<Text>
President Buhari is being expected in the US in just a week and a half from today .
</Text>
<Parse>
1   President   President   PROPN   NNP Number=Sing 5   nsubj:pass  _   _
2   Buhari  Buhari  PROPN   NNP Number=Sing 1   flat    _   _
3   is  be  AUX VBZ Mood=Ind|Number=Sing|Person=3|Tense=Pres|VerbForm=Fin   5   aux _   _
4   being   be  AUX VBG VerbForm=Ger    5   aux:pass    _   _
5   expected    expect  VERB    VBN Tense=Past|VerbForm=Part|Voice=Pass 0   root    _   _
6   in  in  ADP IN  _   8   case    _   _
7   the the DET DT  Definite=Def|PronType=Art   8   det _   _
8   US  US  PROPN   NNP Number=Sing 5   obl _   _
9   in  in  ADP IN  _   12  case    _   _
10  just    just    ADV RB  _   12  advmod  _   _
11  a   a   DET DT  Definite=Ind|PronType=Art   12  det _   _
12  week    week    NOUN    NN  Number=Sing 5   obl _   _
13  and and CCONJ   CC  _   15  cc  _   _
14  a   a   DET DT  Definite=Ind|PronType=Art   15  det _   _
15  half    half    NOUN    NN  Number=Sing 12  conj    _   _
16  from    from    ADP IN  _   17  case    _   _
17  today   today   NOUN    NN  Number=Sing 15  nmod    _   _
18  .   .   PUNCT   .   _   5   punct   _   _
</Parse></Sentence>
JingL1014 commented 6 years ago

The error is fixed. The coder will not crash on these two records now.