{"action":"created","issue":{"url":"https://api.github.com/repos/kbenoit/quanteda/issues/848","repository_url":"https://api.github.com/repos/kbenoit/quanteda","labels_url":"https://api.github.com/repos/kbenoit/quanteda/issues/848/labels{/name}","comments_url":"https://api.github.com/repos/kbenoit/quanteda/issues/848/comments","events_url":"https://api.github.com/repos/kbenoit/quanteda/issues/848/events","html_url":"https://github.com/kbenoit/quanteda/pull/848","id":242334956,"number":848,"title":"Issue 836","user":{"login":"koheiw","id":6572963,"avatar_url":"https://avatars1.githubusercontent.com/u/6572963?v=3","gravatar_id":"","url":"https://api.github.com/users/koheiw","html_url":"https://github.com/koheiw","followers_url":"https://api.github.com/users/koheiw/followers","following_url":"https://api.github.com/users/koheiw/following{/other_user}","gists_url":"https://api.github.com/users/koheiw/gists{/gist_id}","starred_url":"https://api.github.com/users/koheiw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/koheiw/subscriptions","organizations_url":"https://api.github.com/users/koheiw/orgs","repos_url":"https://api.github.com/users/koheiw/repos","events_url":"https://api.github.com/users/koheiw/events{/privacy}","received_events_url":"https://api.github.com/users/koheiw/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2017-07-12T10:40:29Z","updated_at":"2017-07-13T16:56:52Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kbenoit/quanteda/pulls/848","html_url":"https://github.com/kbenoit/quanteda/pull/848","diff_url":"https://github.com/kbenoit/quanteda/pull/848.diff","patch_url":"https://github.com/kbenoit/quanteda/pull/848.patch"},"body":"To solve #836, `tokens_lookup()` now finds multi-word and single-word tokens:\r\n\r\n```r\r\ntoks <- as.tokens(list(d1 = c(\"The\", \"United States of America\", \"and\", \r\n                                   \"the\", \"United\", \"States\", \"of\", \"America\",\r\n                                   \"are\", \"the\", \"same\", \"country\")))\r\nattr(toks, 'concatenator') <- ' '\r\ntokens_lookup(toks, dictionary = dictionary(country = c(\"China\", \"United States of America\")))\r\n\r\n# tokens from 1 document.\r\n# d1 :\r\n# [1] \"country\" \"country\"\r\n```\r\nIt is depends on the `concatenator` attribute of tokens. It is '_' by default."},"comment":{"url":"https://api.github.com/repos/kbenoit/quanteda/issues/comments/315138600","html_url":"https://github.com/kbenoit/quanteda/pull/848#issuecomment-315138600","issue_url":"https://api.github.com/repos/kbenoit/quanteda/issues/848","id":315138600,"user":{"login":"kbenoit","id":2182246,"avatar_url":"https://avatars1.githubusercontent.com/u/2182246?v=3","gravatar_id":"","url":"https://api.github.com/users/kbenoit","html_url":"https://github.com/kbenoit","followers_url":"https://api.github.com/users/kbenoit/followers","following_url":"https://api.github.com/users/kbenoit/following{/other_user}","gists_url":"https://api.github.com/users/kbenoit/gists{/gist_id}","starred_url":"https://api.github.com/users/kbenoit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kbenoit/subscriptions","organizations_url":"https://api.github.com/users/kbenoit/orgs","repos_url":"https://api.github.com/users/kbenoit/repos","events_url":"https://api.github.com/users/kbenoit/events{/privacy}","received_events_url":"https://api.github.com/users/kbenoit/received_events","type":"User","site_admin":false},"created_at":"2017-07-13T16:56:52Z","updated_at":"2017-07-13T16:56:52Z","body":"Re the above:\r\n\r\n- `test-dfm.R` yes it's a mess. I prefer data objects to be defined in the testing block, but these were some of the very first unit tests we wrote. The 🍝 needs untangling...\r\n\r\n- `dfm.dfm()` definitely needs to exist - it not only allows one to construct a dfm from a dfm input using more arguments, but also it's used in the dfm code I think. In general I like the principle of the core constructor objects being able to take their own class as input. See https://github.com/kbenoit/quanteda/issues/690."}}
{"actor":{"display_login":"kbenoit"}}