UniversalPetrarch icon indicating copy to clipboard operation
UniversalPetrarch copied to clipboard

Verb phrase finder doesn't look for prepositions or direct objects

Open ahalterman opened this issue 7 years ago • 6 comments

In looking for parts of the verb phrase, UniversalPetrarch only looks for negations, compounds, and adverbial clause modifiers. It doesn't look for prepositions ("fired AT targets") or direct objects ("chanted SLOGANS). (code) Prepositions and direct objects are major parts of verb patterns (indeed, they're specially marked in the dictionaries to make matching possible). This lack of code rules out using any verb dictionary entries that include any direct objects or prepositions and would explain why the Petr2 dictionaries were working so badly.

ahalterman avatar May 14 '18 17:05 ahalterman

In current coder, the way to handle prepositional phrase is a little bit different from PETR2 implementation. As mentioned in #27, in step 1, the action in the "fired AT targets" is extracted as "fired at", and prepositions are handled inside verb phrase (code)

JingL1014 avatar May 14 '18 18:05 JingL1014

Looking at the code, that seems to handle the comparison between the extracted verb phrase and the dictionaries. What I'm concerned about is the ability of UniversalPetrarch to extract preps and dobjs in the verb phrase from the text to begin with. If it can't extract them correctly, then it won't have any of them to compare against the dictionary in that code chunk. Am I missing something?

ahalterman avatar May 15 '18 16:05 ahalterman

Just checking in on this again, especially since the preposition issue came up in Arabic. Is the code indeed extracting prepositional phrases coming off the verb? And am I right in thinking that that code concerns pattern matching, not phrase extraction?

ahalterman avatar Jul 29 '18 22:07 ahalterman

Yes. Now the coder concerns the prepositions coming off the verb to do the pattern matching. It matches the entire verb phrases (the verb and a sequence of other chunks such as a noun phrase or a prepositional phrase that follow the verb)

JingL1014 avatar Aug 09 '18 04:08 JingL1014

Great! Can you link to the part of the code that implements it, just so I can make sure I understand where it's doing it?

Edit: The original implementation is linked here: #28

ahalterman avatar Aug 09 '18 14:08 ahalterman

The code can be found in function match_lower() starting from line 1660 to line 1700

JingL1014 avatar Aug 09 '18 18:08 JingL1014