textacy icon indicating copy to clipboard operation
textacy copied to clipboard

An example of direct_quotations

Open ghost opened this issue 6 years ago • 1 comments

Hello, I am trying to use this function but it seems that it does not consider these kind of examples:

from textacy import extract as ex
doc=nlp(" Kurds are pitted against Kurds , Iraqis against Kurds , Turks against Kurds -- and the American planes just circle overhead without intervening , " the minister said)
ex.direct_quotations(doc)

Is there any example to show how this function works?

thanks

ghost avatar Jun 12 '18 09:06 ghost

Hi, I just discovered this feature and tried to use it too. With some additional string formatting I got this to work:

from textacy import extract as ex
doc=nlp(" \"Kurds are pitted against Kurds , Iraqis against Kurds , Turks against Kurds -- and the American planes just circle overhead without intervening , \" the minister said")
a=ex.direct_quotations(doc)
for item in a: print (item)

(minister, said, "Kurds are pitted against Kurds , Iraqis against Kurds , Turks against Kurds -- and the American planes just circle overhead without intervening , ")

danieljue avatar Dec 14 '18 19:12 danieljue