{"action":"closed","issue":{"url":"https://api.github.com/repos/nltk/nltk_book/issues/102","labels_url":"https://api.github.com/repos/nltk/nltk_book/issues/102/labels{/name}","comments_url":"https://api.github.com/repos/nltk/nltk_book/issues/102/comments","events_url":"https://api.github.com/repos/nltk/nltk_book/issues/102/events","html_url":"https://github.com/nltk/nltk_book/issues/102","id":57561032,"number":102,"title":"Wrong usage of name corpus in `apply_features()` in chap6","user":{"login":"alvations","id":1050316,"avatar_url":"https://avatars.githubusercontent.com/u/1050316?v=3","gravatar_id":"","url":"https://api.github.com/users/alvations","html_url":"https://github.com/alvations","followers_url":"https://api.github.com/users/alvations/followers","following_url":"https://api.github.com/users/alvations/following{/other_user}","gists_url":"https://api.github.com/users/alvations/gists{/gist_id}","starred_url":"https://api.github.com/users/alvations/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alvations/subscriptions","organizations_url":"https://api.github.com/users/alvations/orgs","repos_url":"https://api.github.com/users/alvations/repos","events_url":"https://api.github.com/users/alvations/events{/privacy}","received_events_url":"https://api.github.com/users/alvations/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-02-13T05:25:05Z","updated_at":"2015-02-14T03:29:58Z","closed_at":"2015-02-14T03:29:58Z","body":"The code section was giving the wrong usage of `apply_features` by accessing the name corpus as an array (from http://www.nltk.org/book/ch06.html). \r\n\r\n```\r\n>>> from nltk.classify import apply_features\r\n>>> train_set = apply_features(gender_features, names[500:])\r\n>>> test_set = apply_features(gender_features, names[:500])\r\n```\r\n\r\nShould have been\r\n\r\n```\r\n>>> from nltk.classify import apply_features\r\n>>> train_set = apply_features(gender_features, labeled_names[500:])\r\n>>> test_set = apply_features(gender_features, labeled_names[:500])\r\n```\r\n\r\nFor details, see http://stackoverflow.com/questions/28469476/typeerror-wordlistcorpusreader-object-has-no-attribute-getitem-while-us\r\n\r\n"}}