Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ID | date | POS tagged text | pattern | ...
- 123 | 2009-03-27 | gross_JJ domestic_JJ product_NN | the_DT most_NN | ...
- step1 <- function(df){
- df %>%
- partition(variable, cluster=cl) %>%
- dplyr::filter(str_detect(phrases, paste(patternList, collapse = '|'))) %>%
- collect()
- }
- preprocess <- function(p) {
- lapply(p, function(x) {
- x = gsub("\/\/", "_", x)
- })
- }
- df$variable <- unlist(preprocess(df$variable))
- ## Again using multidplyr and skipping some lines of code
- partition(source_code, cluster=cl) %>%
- mutate(match=str_detect(POStagged, pattern)) %>%
- filter(!(match==FALSE)) %>%
- filter(!is.na(match))
- preprocess <- function(df) {
- lapply(df, function(POStagged, pattern) {
- mutate(p = str_detect(POStagged, pattern))
- filter(!(p==FALSE))
- filter(!is.na(p))
- })
- }
- data_sample$match <- unlist(preprocess(data_sample))
- Error in type(pattern) : argument "pattern" is missing, with no default
- R version 3.4.4 (2018-03-15)
- Platform: x86_64-pc-linux-gnu (64-bit)
- Running under: Ubuntu 16.04.5 LTS
Add Comment
Please, Sign In to add comment