Message from discussion
The Method of Insert doesn't work. AttributeError: 'ConcatenatedCorpusView' object has no attribute 'insert'
Received: by 10.205.130.14 with SMTP id hk14mr1651608bkc.5.1346656987591;
Mon, 03 Sep 2012 00:23:07 -0700 (PDT)
X-BeenThere: nltk-users@googlegroups.com
Received: by 10.204.4.74 with SMTP id 10ls388332bkq.0.gmail; Mon, 03 Sep 2012
00:23:05 -0700 (PDT)
Received: by 10.204.130.7 with SMTP id q7mr1654674bks.2.1346656985640;
Mon, 03 Sep 2012 00:23:05 -0700 (PDT)
Received: by 10.204.130.7 with SMTP id q7mr1654671bks.2.1346656985609;
Mon, 03 Sep 2012 00:23:05 -0700 (PDT)
Return-Path: <peter.ljung...@heatherleaf.se>
Received: from mailgw8.surf-town.net (mail2.surf-town.net. [212.97.132.42])
by gmr-mx.google.com with ESMTP id j4si3015147bkj.3.2012.09.03.00.23.05;
Mon, 03 Sep 2012 00:23:05 -0700 (PDT)
Received-SPF: neutral (google.com: 212.97.132.42 is neither permitted nor denied by best guess record for domain of peter.ljung...@heatherleaf.se) client-ip=212.97.132.42;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 212.97.132.42 is neither permitted nor denied by best guess record for domain of peter.ljung...@heatherleaf.se) smtp.mail=peter.ljung...@heatherleaf.se
Received: by mailgw8.surf-town.net (Postfix, from userid 65534)
id 17281AFE1E; Mon, 3 Sep 2012 09:23:05 +0200 (CEST)
Received: from localhost (localhost [127.0.0.1])
by mailgw8.surf-town.net (Postfix) with ESMTP id 04CC6AFA96
for <nltk-users@googlegroups.com>; Mon, 3 Sep 2012 09:23:05 +0200 (CEST)
X-Virus-Scanned: Debian amavisd-new at mailgw8.surf-town.net
X-Spam-Flag: NO
X-Spam-Score: -1.44
X-Spam-Level:
X-Spam-Status: No, score=-1.44 tagged_above=-999 required=7
tests=[ALL_TRUSTED=-1.44] autolearn=disabled
Received: from mailgw8.surf-town.net ([127.0.0.1])
by localhost (mailgw8.surf-town.net [127.0.0.1]) (amavisd-new, port 10024)
with LMTP id WKxWdW4BT6wk for <nltk-users@googlegroups.com>;
Mon, 3 Sep 2012 09:23:02 +0200 (CEST)
Received: from [10.0.1.10] (dhcp2-022135.cs.chalmers.se [129.16.22.135])
by mailgw8.surf-town.net (Postfix) with ESMTPSA id A48A4AFCB5
for <nltk-users@googlegroups.com>; Mon, 3 Sep 2012 09:23:02 +0200 (CEST)
Content-Type: text/plain; charset=iso-8859-1
Mime-Version: 1.0 (Apple Message framework v1278)
Subject: Re: [nltk-users] The Method of Insert doesn't work. AttributeError: 'ConcatenatedCorpusView' object has no attribute 'insert'
From: =?iso-8859-1?Q?peter_ljungl=F6f?= <peter.ljung...@heatherleaf.se>
In-Reply-To: <CAE5RzXmi-gPdChmLzQj0Jkr1KYYcgMDHh1qUp3tGeOAYY3g...@mail.gmail.com>
Date: Mon, 3 Sep 2012 09:23:10 +0200
Content-Transfer-Encoding: quoted-printable
Message-Id: <0077B002-A2B4-4439-9D2F-77B37F7B0...@heatherleaf.se>
References: <c71691c7-6998-4512-a9b8-cc5849cebd29@googlegroups.com> <CAAxp+om9ZRB2LL2xTOAMKhuKQhZ9H7r5P0dayk=FGpdBgWD...@mail.gmail.com> <CAE5RzXmi-gPdChmLzQj0Jkr1KYYcgMDHh1qUp3tGeOAYY3g...@mail.gmail.com>
To: nltk-users@googlegroups.com
X-Mailer: Apple Mail (2.1278)
3 sep 2012 kl. 04:44 skrev John H. Li:
> Isn't text in NLTK corpus in a list format already? I am puzzled. I =
tested the text from nltk as follows. It is a list actually. See the =
following:
> >>> text =3D nltk.corpus.brown.words(categories =3D 'news')
> >>> text[:10]
> ['The', 'Fulton', 'County', 'Grand', 'Jury', 'said', 'Friday', 'an', =
'investigation', 'of']
You did just implicitly convert it to a list:
>>> type(text)
<class 'nltk.corpus.reader.util.ConcatenatedCorpusView'>
>>> type(text[:10])
<type 'list'>
/Peter=