This pull request corresponding the issue #108. It solves the issue but while solving this , when I tried to run the program
from pattern.web import Bing, plaintext
from pattern.en import parsetree
from pattern.search import search
from pattern.graph import Graph
g = Graph()
for i in range(10):
for result in Bing().search('"more important than"', start=i+1, count=50):
s = r.text.lower()
s = plaintext(s)
s = parsetree(s)
p = '{NP} (VP) more important than {NP}'
for m in search(p, s):
x = m.group(1).string # NP left
y = m.group(2).string # NP right
if x not in g:
g.add_node(x)
if y not in g:
g.add_node(y)
g.add_edge(g[x], g[y], stroke=(0,0,0,0.75)) # R,G,B,A
g = g.split()[0] # Largest subgraph.
for n in g.sorted()[:40]: # Sort by Node.weight.
n.fill = (0, 0.5, 1, 0.75 * n.weight)
g.export('test', directed=True, weighted=0.6)
But gives the following error:
Traceback (most recent call last):
File "demo.py", line 8, in <module>
for result in Bing().search('"more important than"', start=i+1, count=50):
File "/usr/local/lib/python2.7/dist-packages/pattern/web/__init__.py", line 1281, in search
data = url.download(cached=cached, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/pattern/web/__init__.py", line 437, in download
data = self.open(timeout, proxy, user_agent, referrer, authentication).read()
File "/usr/local/lib/python2.7/dist-packages/pattern/web/__init__.py", line 412, in open
raise URLError(str(e), src=e, url=url)
pattern.web.URLError: Invalid header value 'Basic OlZuSkVLNEhUbG50RTNTeUY1OFFMa1VDTHAvNzh0a1lqVjFGbDNKN2xIYTA9\n'
Is this a specific issue to my installation or a general.
If it is a general issue I would like to work on it. For that can someone please guide me, where to start.
This pull request corresponding the issue #108. It solves the issue but while solving this , when I tried to run the program
But gives the following error:
Is this a specific issue to my installation or a general. If it is a general issue I would like to work on it. For that can someone please guide me, where to start.
Thanks, Ankit