Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bool_detect.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ bool_detect = function(x, b, ignore_case = TRUE, in_word = TRUE, full_word = FAL
i = nchar(b)
while(i > 0){
item = stri_extract_last(b, regex = '\\b[^\\s\\(\\)\\&\\|]+') # whole word not inc logicals
#item = stri_extract_last(b, regex = '[^\\s\\(\\)\\&\\|\\-]+') # Jim's modification
print(item)
if(!is.na(item) & item != ''){
posn = stri_locate_last(b, fixed = item)[1,] # position of last search term
orig_item = str_replace_all(item, sep, ' ')
Expand All @@ -53,7 +55,7 @@ bool_detect = function(x, b, ignore_case = TRUE, in_word = TRUE, full_word = FAL
}

subs = subs %>% bind_rows() # to data.frame

print(subs)
# convert terms into own str_detect calls
for(i in 1:nrow(subs)){
b_head = substr(b0, 1, subs$start[i]-1)
Expand Down