Skip to content
This repository has been archived by the owner on Sep 10, 2020. It is now read-only.

NotImplementedError: Use label() to access a node label. #12

Open
awhan opened this issue Jun 1, 2016 · 2 comments
Open

NotImplementedError: Use label() to access a node label. #12

awhan opened this issue Jun 1, 2016 · 2 comments

Comments

@awhan
Copy link

awhan commented Jun 1, 2016

pip installed geograpy on archlinux box and tried out this simple program

import geoprapy
t = 'India is a country'
p = geoprapy.get_place_context(text=t)

I got the following error

In [3]: p = geograpy.get_place_context(text=txt)
---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
<ipython-input-3-ae088bc75e75> in <module>()
----> 1 p = geograpy.get_place_context(text=txt)

/home/m/.local/lib/python2.7/site-packages/geograpy/__init__.pyc in get_place_context(url, text)
      4 def get_place_context(url=None, text=None):
      5     e = Extractor(url=url, text=text)
----> 6     e.find_entities()
      7
      8     pc = PlaceContext(e.places)

/home/m/.local/lib/python2.7/site-packages/geograpy/extraction.pyc in find_entities(self)
     29         for ne in nes:
     30             if len(ne) == 1:
---> 31                 if (ne.node == 'GPE' or ne.node == 'PERSON') and ne[0][1] == 'NNP':
     32                     self.places.append(ne[0][0])

/usr/lib/python2.7/site-packages/nltk/tree.pyc in _get_node(self)
    196     def _get_node(self):
    197         """Outdated method to access the node value; use the label() method instead."""
--> 198         raise NotImplementedError("Use label() to access a node label.")
    199     def _set_node(self, value):
    200         """Outdated method to set the node value; use the set_label() method instead."""

NotImplementedError: Use label() to access a node label.
Python version 2.7.11
Linux zero 4.5.4-1-ARCH #1 SMP PREEMPT Wed May 11 22:21:28 CEST 2016 x86_64 GNU/Linux
@botsplash
Copy link

@WolfgangFahl
Copy link

you might want to use the more recent https://github.com/somnathrakshit/geograpy3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants