{"action":"created","issue":{"url":"https://api.github.com/repos/nltk/nltk/issues/1117","labels_url":"https://api.github.com/repos/nltk/nltk/issues/1117/labels{/name}","comments_url":"https://api.github.com/repos/nltk/nltk/issues/1117/comments","events_url":"https://api.github.com/repos/nltk/nltk/issues/1117/events","html_url":"https://github.com/nltk/nltk/issues/1117","id":105259447,"number":1117,"title":"Add a method returning the content of a corpus as Text object","user":{"login":"stieglma","id":6758666,"avatar_url":"https://avatars.githubusercontent.com/u/6758666?v=3","gravatar_id":"","url":"https://api.github.com/users/stieglma","html_url":"https://github.com/stieglma","followers_url":"https://api.github.com/users/stieglma/followers","following_url":"https://api.github.com/users/stieglma/following{/other_user}","gists_url":"https://api.github.com/users/stieglma/gists{/gist_id}","starred_url":"https://api.github.com/users/stieglma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stieglma/subscriptions","organizations_url":"https://api.github.com/users/stieglma/orgs","repos_url":"https://api.github.com/users/stieglma/repos","events_url":"https://api.github.com/users/stieglma/events{/privacy}","received_events_url":"https://api.github.com/users/stieglma/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-07T19:18:57Z","updated_at":"2015-09-08T07:44:31Z","closed_at":null,"body":"During our studies we found it quite useful to have a method returning the words of a corpus wrapped in a text object, such that the concordance view and many other methods can be used.\r\nAs suggested from @stevenbird in the pull request #1112 I would propose to add this method to the CorpusReader class, such that it will be available for all corpora.\r\n\r\nHere is the code we used in our corpus reader before:\r\n\r\n```python\r\ndef text(self, fileids=None):\r\n    \"\"\"\r\n    :param fileids: A list specifying the fileids that should be used.\r\n    :return: the given file(s) concatenated and wrapped in a Text object of NLTK\r\n    :rtype: Text\r\n    \"\"\"\r\n    return Text(self.words(fileids))\r\n```"},"comment":{"url":"https://api.github.com/repos/nltk/nltk/issues/comments/138464134","html_url":"https://github.com/nltk/nltk/issues/1117#issuecomment-138464134","issue_url":"https://api.github.com/repos/nltk/nltk/issues/1117","id":138464134,"user":{"login":"stieglma","id":6758666,"avatar_url":"https://avatars.githubusercontent.com/u/6758666?v=3","gravatar_id":"","url":"https://api.github.com/users/stieglma","html_url":"https://github.com/stieglma","followers_url":"https://api.github.com/users/stieglma/followers","following_url":"https://api.github.com/users/stieglma/following{/other_user}","gists_url":"https://api.github.com/users/stieglma/gists{/gist_id}","starred_url":"https://api.github.com/users/stieglma/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stieglma/subscriptions","organizations_url":"https://api.github.com/users/stieglma/orgs","repos_url":"https://api.github.com/users/stieglma/repos","events_url":"https://api.github.com/users/stieglma/events{/privacy}","received_events_url":"https://api.github.com/users/stieglma/received_events","type":"User","site_admin":false},"created_at":"2015-09-08T07:44:31Z","updated_at":"2015-09-08T07:44:31Z","body":"You are right, the Text object can also easily be used without the method of the reader (which has to be done anyway if you want something else as Text than the whole corpus (or the via fileids selected parts). The only benefit I see, is that you don't have to import nltk.Text manually, as it will be done by the corpus reader, but that's not really worth it.\r\nThe reason why we had this method, was just to provide a faster way to get to the (default) Text object for our corpus, which will be only the case if you know that this method exists. As hardly anybody knows about it, integrating the method doesn't make as much sense as we thought before."}}