{"action":"created","issue":{"url":"https://api.github.com/repos/bnosac/udpipe/issues/20","repository_url":"https://api.github.com/repos/bnosac/udpipe","labels_url":"https://api.github.com/repos/bnosac/udpipe/issues/20/labels{/name}","comments_url":"https://api.github.com/repos/bnosac/udpipe/issues/20/comments","events_url":"https://api.github.com/repos/bnosac/udpipe/issues/20/events","html_url":"https://github.com/bnosac/udpipe/issues/20","id":308374501,"number":20,"title":"In keywords_phrases() function the is_regex=T option has broken in 0.5","user":{"login":"sanjmeh","id":3091624,"avatar_url":"https://avatars2.githubusercontent.com/u/3091624?v=4","gravatar_id":"","url":"https://api.github.com/users/sanjmeh","html_url":"https://github.com/sanjmeh","followers_url":"https://api.github.com/users/sanjmeh/followers","following_url":"https://api.github.com/users/sanjmeh/following{/other_user}","gists_url":"https://api.github.com/users/sanjmeh/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjmeh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjmeh/subscriptions","organizations_url":"https://api.github.com/users/sanjmeh/orgs","repos_url":"https://api.github.com/users/sanjmeh/repos","events_url":"https://api.github.com/users/sanjmeh/events{/privacy}","received_events_url":"https://api.github.com/users/sanjmeh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-25T18:49:09Z","updated_at":"2018-03-25T19:54:37Z","closed_at":null,"author_association":"NONE","body":"I am running side by side the same code, same data on two machines. \r\n\r\nOne is on udpipe 0.4 and the other on udpipe 0.5 version.\r\n\r\nThe `keywords_phrases()` function is broken on 0.5 if we use `is_regex=T`\r\n\r\nConsider the sample example in your help document.\r\n\r\n```\r\ndata(brussels_reviews_anno, package = \"udpipe\")\r\nx <- subset(brussels_reviews_anno, language %in% \"fr\")\r\nnp <- keywords_phrases(x$xpos, pattern = c(\"DT\", \"NN\", \"VB\", \"RB\", \"JJ\"), sep = \"-\")\r\nhead(np)\r\n\r\n```\r\n\r\nThe above should work in both 0.4 & 0.5.\r\n\r\nNow consider the same example but with the function executed with `is_regex=T`\r\n\r\n```\r\nnp <- keywords_phrases(x$xpos, pattern = c(\"DTNNVBRBJJ\"), term = x$token,is_regex=T)\r\nhead(np)\r\n# [1] keyword ngram   pattern start   end    \r\n# <0 rows> (or 0-length row.names)\r\n```\r\nI tried with many regex, even as simple as just `pattern = \"DTJJ\"` but none works. It seems the regex option does not work.\r\n\r\nI have also tested that regex works on the machine (an ubuntu server) by checking out the `grep ` family of commands in R. So regex does not work in the udipe function only,\r\n"},"comment":{"url":"https://api.github.com/repos/bnosac/udpipe/issues/comments/375998352","html_url":"https://github.com/bnosac/udpipe/issues/20#issuecomment-375998352","issue_url":"https://api.github.com/repos/bnosac/udpipe/issues/20","id":375998352,"user":{"login":"jwijffels","id":1710810,"avatar_url":"https://avatars3.githubusercontent.com/u/1710810?v=4","gravatar_id":"","url":"https://api.github.com/users/jwijffels","html_url":"https://github.com/jwijffels","followers_url":"https://api.github.com/users/jwijffels/followers","following_url":"https://api.github.com/users/jwijffels/following{/other_user}","gists_url":"https://api.github.com/users/jwijffels/gists{/gist_id}","starred_url":"https://api.github.com/users/jwijffels/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jwijffels/subscriptions","organizations_url":"https://api.github.com/users/jwijffels/orgs","repos_url":"https://api.github.com/users/jwijffels/repos","events_url":"https://api.github.com/users/jwijffels/events{/privacy}","received_events_url":"https://api.github.com/users/jwijffels/received_events","type":"User","site_admin":false},"created_at":"2018-03-25T19:54:37Z","updated_at":"2018-03-25T19:54:37Z","author_association":"CONTRIBUTOR","body":"Thanks for reporting. Tested this out on Windows and this did gave 72 results for\r\n`np <- keywords_phrases(x$xpos, pattern = c(\"DTNNVBRBJJ\"), term = x$token,is_regex=T)`\r\nOn version 0.4 as well as version 0.5. Also there has not been a change in the function when comparing version 0.4 to version 0.5 of this R package.\r\n\r\nSo this seems to be Linux specific. The regular expression uses <regex> from C++11, this was only released in version gcc 4.9.0. Which version of gcc do you have on your machine (what does `gcc --version` indicate) "}}
{"actor":{"display_login":"jwijffels"}}