fixed some pattern detection bugs
This commit is contained in:
@@ -28,13 +28,13 @@ convertLogical0 <- function(var) {
|
||||
|
||||
smartPatternMatch <- function(string, pattern, chars) {
|
||||
if(chars < 5) {
|
||||
found <- agrep(pattern, string, max.distance = list(all = 0), ignore.case = TRUE)
|
||||
found <- agrep(pattern, string, max.distance = list(all = 0), ignore.case = TRUE, fixed = FALSE)
|
||||
}
|
||||
if(chars > 7) {
|
||||
found <- agrep(pattern, string, max.distance = list(all = 2), ignore.case = TRUE)
|
||||
else if(chars > 7) {
|
||||
found <- agrep(pattern, string, max.distance = list(all = 2), ignore.case = TRUE, fixed = FALSE)
|
||||
}
|
||||
else {
|
||||
found <- agrep(pattern, string, max.distance = list(all = 1), ignore.case = TRUE)
|
||||
found <- agrep(pattern, string, max.distance = list(all = 1), ignore.case = TRUE, fixed = FALSE)
|
||||
}
|
||||
found <- convertLogical0(found)
|
||||
return(found)
|
||||
|
||||
Reference in New Issue
Block a user