On Saturday, February 27, 2016 at 9:43:56 PM UTC+5:30, Rustom Mody wrote:
> On Saturday, February 27, 2016 at 2:47:53 PM UTC+5:30, subhaba...@gmail.com
> wrote:
> > I was trying to implement the code,
> >
> > import nltk
> > import nltk.tag, nltk.chunk, itertools
> > def
On Saturday, February 27, 2016 at 2:47:53 PM UTC+5:30, subhaba...@gmail.com
wrote:
> I was trying to implement the code,
>
> import nltk
> import nltk.tag, nltk.chunk, itertools
> def ieertree2conlltags(tree, tag=nltk.tag.pos_tag):
> words, ents = zip(*tree.pos())
> iobs = []
> prev
On Sat, 27 Feb 2016 08:17 pm, subhabangal...@gmail.com wrote:
> Is it any error in Python part or in NLTK part?
Neither.
Any time you think there is an error in Python, it is 99.9% sure that the
error is in your code, not Python.
If the error is a SyntaxError, that is 99.9%.
> If any one
I was trying to implement the code,
import nltk
import nltk.tag, nltk.chunk, itertools
def ieertree2conlltags(tree, tag=nltk.tag.pos_tag):
words, ents = zip(*tree.pos())
iobs = []
prev = None
for ent in ents:
if ent == tree.node:
iobs.append('O')
On Jul 26, 6:53 am, Bevan Jenkins beva...@gmail.com wrote:
Hello,
I am trying to create a tree structure for use with a PyQt QTreeView.
But first I need to get my head around how to create the tree
structure. I have a dictionary (for testing purposes) but I will
later use a table via
Bevan Jenkins wrote:
Hello,
I am trying to create a tree structure for use with a PyQt QTreeView.
But first I need to get my head around how to create the tree
structure. I have a dictionary (for testing purposes) but I will
later use a table via sqlalchemy.
The use case is hydrology
On Jul 26, 8:46 pm, Peter Otten __pete...@web.de wrote:
Bevan Jenkins wrote:
Hello,
I am trying to create a tree structure for use with a PyQt QTreeView.
But first I need to get my head around how to create the tree
structure. I have a dictionary (for testing purposes) but I
Hello,
I am trying to create a tree structure for use with a PyQt QTreeView.
But first I need to get my head around how to create the tree
structure. I have a dictionary (for testing purposes) but I will
later use a table via sqlalchemy.
The use case is hydrology, so I would like to have
On Sun, Apr 04, 2010 at 12:10:02PM +, Steven D'Aprano wrote:
I can implement this tree using a flat dict:
root = object()
data = {root: ['Mammal', 'Reptile'],
What is the advantage, or thougth behind, using an instance
of object as the root of your flat tree ?
egbert
--
Egbert
On Tue, 06 Apr 2010 19:16:05 +0200, egbert wrote:
On Sun, Apr 04, 2010 at 12:10:02PM +, Steven D'Aprano wrote:
I can implement this tree using a flat dict:
root = object()
data = {root: ['Mammal', 'Reptile'],
What is the advantage, or thougth behind, using an instance of object as
On 04/07/10 14:18, Steven D'Aprano wrote:
I could have used None, or root, or this is a magic value that
probably won't clash with an entry in the tree, or -1 as a sentinel
instead, but they all risk accidental clashes with tree entries.
Especially when you want to consider the possibility
I have a hierarchical structure something like a directory tree or a
nested tree structure:
Mammal
+-- Ape
: +-- Chimpanzee
: +-- Gorilla
: +-- Human
+-- Carnivore
: +-- Cat
: +-- Tiger
Reptile
+-- Lizard
+-- Snake
+-- Cobra
+-- Python
This is a forest because each top
* Steven D'Aprano:
I have a hierarchical structure something like a directory tree or a
nested tree structure:
Mammal
+-- Ape
: +-- Chimpanzee
: +-- Gorilla
: +-- Human
+-- Carnivore
: +-- Cat
: +-- Tiger
Reptile
+-- Lizard
+-- Snake
+-- Cobra
+-- Python
This is a forest
Steven D'Aprano st...@remove-this-cybersource.com.au wrote:
I have a hierarchical structure something like a directory tree or a
nested tree structure:
Mammal
+-- Ape
: +-- Chimpanzee
: +-- Gorilla
: +-- Human
+-- Carnivore
: +-- Cat
: +-- Tiger
Reptile
+-- Lizard
Steven D'Aprano, 04.04.2010 14:10:
I have a hierarchical structure something like a directory tree or a
nested tree structure:
Mammal
+-- Ape
: +-- Chimpanzee
: +-- Gorilla
: +-- Human
+-- Carnivore
: +-- Cat
: +-- Tiger
Reptile
+-- Lizard
+-- Snake
+-- Cobra
+-- Python
On Apr 4, 9:06 am, Duncan Booth duncan.bo...@invalid.invalid wrote:
Do you have any carniverous apes? If so it's a directed acyclic graph.
Well, since he has a root node, he's really only described the *use*
of this data structure implementation for a rooted tree.
As you point out, the
On Apr 4, 10:41 am, Patrick Maupin pmau...@gmail.com wrote:
The primary differences between this structure and just haphazardly
wiring up random objects into a directed graph are that (1) there may
be some performance differences (but when the garbage collector has to
figure out how to break
Is there any python class to display the drive and folder structure as
a tree(As you see in the windows explorer window)??
http://wiki.wxpython.org/TreeControls
S
--
http://mail.python.org/mailman/listinfo/python-list
Hello,
Is there any python class to display the drive and folder structure as
a tree(As you see in the windows explorer window)??
Thanks,
Girish..
--
http://mail.python.org/mailman/listinfo/python-list
On Oct 9, 5:02 am, Girish girish@gmail.com wrote:
Is there any python class to display the drive and folder structure as
a tree(As you see in the windows explorer window)??
You could use a recursive function to print it out of course or you
will need to use a GUI kit. wxPython has a tree
Hi,
I am creating a tree data-structure in python; with nodes of the tree
created by a simple class :
class Node :
def __init__(self , other attributes):
# initialise the attributes here!!
But the problem is I am working with a huge tree (millions of nodes); and
each
On Mon, Jul 6, 2009 at 2:55 AM, mayank guptamooni...@gmail.com wrote:
Hi,
I am creating a tree data-structure in python; with nodes of the tree
created by a simple class :
class Node :
def __init__(self , other attributes):
# initialise the attributes here!!
But
Thanks for the other possibilites. I would consider option (2) and (3) to
improve my code.
But out of curiosity, I would still like to know why does an object of a
Python-class consume so much of memory (1.4 kb), and this memory usage has
nothing to do with its attributes.
Thanks
Regards.
On
On Mon, Jul 6, 2009 at 6:12 AM, mayank guptamooni...@gmail.com wrote:
Thanks for the other possibilites. I would consider option (2) and (3) to
improve my code.
But out of curiosity, I would still like to know why does an object of a
Python-class consume so much of memory (1.4 kb), and this
mayank gupta mooniitk at gmail.com writes:
After a little analysis, I found out that in general it uses about
1.4 kb of memory for each node!!
How did you measure memory use? Python objects are not very compact, but 1.4KB
per object seems a bit too much (I would expect more about 150-200
I worked out a small code which initializes about 1,000,000 nodes with some
attributes, and saw the memory usage on my linux machine (using 'top'
command). Then just later I averaged out the memory usage per node. I know
this is not the most accurate way but just for estimated value.
The kind of
On Tue, Jul 7, 2009 at 1:28 AM, Antoine Pitrou solip...@pitrou.net wrote:
mayank gupta mooniitk at gmail.com writes:
After a little analysis, I found out that in general it uses about
1.4 kb of memory for each node!!
How did you measure memory use? Python objects are not very compact,
On 17 juin, 13:53, méchoui [EMAIL PROTECTED] wrote:
On Jun 17, 9:08 am, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Yes, I need to make sure my requests are properly written so that the
generic XPath engine does not need all the structure in memory.
There are quite a few cases where
On Jun 17, 11:54 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Do you know if there is suchXPathengine that can be applied to a DOM-
like structure ?
No. But I toyed with the idea to write one :)
One way would be to take anXPathengine from an existing XML engine
(ElementTree, or any
On Jun 17, 10:54 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Do you know if there is such XPath engine that can be applied to a DOM-
like structure ?
No. But I toyed with the idea to write one :)
One way would be to take an XPath engine from an existing XML engine
(ElementTree, or any
Yes, I need to make sure my requests are properly written so that the
generic XPath engine does not need all the structure in memory.
There are quite a few cases where you really don't need to load
everything at all. /a/b/*/c/d is an example. But even with an example
like /x/z[last()]/t, you
On Jun 17, 9:08 am, Diez B. Roggisch [EMAIL PROTECTED] wrote:
Yes, I need to make sure my requests are properly written so that the
generic XPath engine does not need all the structure in memory.
There are quite a few cases where you really don't need to load
everything at all. /a/b/*/c/d
Do you know if there is such XPath engine that can be applied to a DOM-
like structure ?
No. But I toyed with the idea to write one :)
One way would be to take an XPath engine from an existing XML engine
(ElementTree, or any other), and see what APIs it calls... and see if
we cannot create
Problem:
- You have tree structure (XML-like) that you don't want to create
100% in memory, because it just takes too long (for instance, you need
a http request to request the information from a slow distant site).
- But you want to be able to request data from it, such has give me
all nodes
méchoui schrieb:
Problem:
- You have tree structure (XML-like) that you don't want to create
100% in memory, because it just takes too long (for instance, you need
a http request to request the information from a slow distant site).
- But you want to be able to request data from it, such has
On Jun 16, 11:16 pm, Diez B. Roggisch [EMAIL PROTECTED] wrote:
méchoui schrieb:
Problem:
- You have tree structure (XML-like) that you don't want to create
100% in memory, because it just takes too long (for instance, you need
a http request to request the information from a slow
36 matches
Mail list logo