Fuzzywuzzy

Latest version: v0.18.0

Safety actively analyzes 681775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

123.0

})
testthat::test_that("the method takes as input a numeric value", {
skip_test_if_no_module("fuzzywuzzy.utils")
init = FuzzUtils$new()
testthat::expect_true( init$Asciidammit(input = numeric(0)) == "[]" )
})
testthat::test_that("the method takes as input a numeric value", {
skip_test_if_no_module("fuzzywuzzy.utils")
init = FuzzUtils$new()
testthat::expect_true( init$Asciidammit(input = NULL) == "None" )
})
st1
UTILS$asciionly(st1)
UTILS$asciionly(1233)
UTILS$asciionly(list(123))
source('~/ADD_GITHUB/fuzzywuzzyR/R/fuzzy_w.R')
testthat::test_that("input is non-NULL", {
skip_test_if_no_module("fuzzywuzzy.utils")
init = FuzzUtils$new()
testthat::expect_error( init$Asciionly(string = NULL) )
})
testthat::test_that("input is character string", {
skip_test_if_no_module("fuzzywuzzy.utils")
init = FuzzUtils$new()
testthat::expect_error( init$Asciionly(string = 1) )
})
init$Asciionly(string = st1)
UTILS$validate_string(1)
UTILS$validate_string("a")
UTILS$validate_string(list("a"))
UTILS$validate_string(list("a", 'b'))
UTILS$validate_string(list("a", 'b', 1))
testthat::test_that("input is non-NULL", {
skip_test_if_no_module("fuzzywuzzy.utils")
init = FuzzUtils$new()
testthat::expect_error( init$Validate_string(string = NULL) )
})
testthat::test_that("input is character string", {
skip_test_if_no_module("fuzzywuzzy.utils")
init = FuzzUtils$new()
testthat::expect_error( init$Validate_string(string = 1) )
})
testthat::test_that("the method returns the expected output", {
skip_test_if_no_module("fuzzywuzzy.utils")
init = FuzzUtils$new()
testthat::expect_true( init$Validate_string(string = st1) == TRUE )
})
init$Validate_string(string = character(0))
init = FuzzExtract$new()
init$Extract(string = NULL, processor = NULL, scorer = NULL, limit = 5L)
init$Extract(string = word, sequence_strings = NULL, processor = NULL, scorer = NULL, limit = 5L)
init$Extract(string = 1, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = 5L)
init$Extract(string = word, sequence_strings = 1, processor = NULL, scorer = NULL, limit = 5L)
testthat::test_that("the string argument is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$Extract(string = NULL, processor = NULL, scorer = NULL, limit = 5L) )
})
testthat::test_that("the sequence_strings argument is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$Extract(string = word, sequence_strings = NULL, processor = NULL, scorer = NULL, limit = 5L) )
})
testthat::test_that("the string argument is a character string", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$Extract(string = 1, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = 5L) )
})
testthat::test_that("the sequence_strings argument is a character vector", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$Extract(string = word, sequence_strings = 1, processor = NULL, scorer = NULL, limit = 5L) )
})
s1 = ' It was a dark and stormy night. I was all alone sitting on a red chair.'
s2 = ' It was a murky and stormy night. I was all alone sitting on a crimson chair.'
word = 'Fra Bagg'
vec_getclose = c('Frodo Baggins', 'Tom Sawyer', 'Bilbo Baggin')
st1 = "Atlanta Falcons"
st2 = "New York Jets"
tmp_init = FuzzMatcher$new()
tmp_sc = tmp_init$WRATIO defaults to 'FuzzMatcher.WRATIO()'
EXTRACT$extract(word, vec_getclose, NULL, tmp_sc, 5L)
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
init$Extract(string = word, sequence_strings = vec_getclose, processor = list(), scorer = SCOR, limit = 5L)
source('~/ADD_GITHUB/fuzzywuzzyR/R/fuzzy_w.R')
init$Extract(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = SCOR, limit = 5L)
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
init$Extract(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = SCOR, limit = 5L)
init$Extract(string = word, sequence_strings = vec_getclose, processor = list(), scorer = SCOR, limit = 5L)
testthat::test_that("the processor argument is a function in case that is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$Extract(string = word, sequence_strings = vec_getclose, processor = list(), scorer = SCOR, limit = 5L) )
})
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
init$Extract(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = list(), limit = 5L)
testthat::test_that("the scorer argument is a function in case that is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$Extract(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = list(), limit = 5L) )
})
init$Extract(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = '5L')
testthat::test_that("the limit argument is a numeric value", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$Extract(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = '5L') )
})
init$Extract(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = 5L)
res_lst = init$Extract(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = 5L)
unlist(lapply(res_lst, function(x) x[[1]]))
unlist(lapply(res_lst, function(x) x[[2]]))
inherits(unlist(lapply(res_lst, function(x) x[[2]])), c('numeric', 'vector'))
class(unlist(lapply(res_lst, function(x) x[[2]])))
inherits(unlist(lapply(res_lst, function(x) x[[2]])), c('integer', 'vector'))
inherits(unlist(lapply(res_lst, function(x) x[[1]])), c('character', 'vector'))
testthat::test_that("returns the expected output if scorer is NULL - processor takes default function", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$Extract(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = 5L)
testthat::expect_true( inherits(unlist(lapply(res_lst, function(x) x[[1]])), c('character', 'vector')) && inherits(unlist(lapply(res_lst, function(x) x[[2]])), c('integer', 'vector')) )
})
testthat::test_that("returns the expected output if scorer is not NULL - processor takes default function", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$Extract(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = SCOR, limit = 5L)
testthat::expect_true( inherits(unlist(lapply(res_lst, function(x) x[[1]])), c('character', 'vector')) && inherits(unlist(lapply(res_lst, function(x) x[[2]])), c('integer', 'vector')) )
})
testthat::test_that("the string argument is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractBests(string = NULL, processor = NULL, scorer = NULL, limit = 5L) )
})
testthat::test_that("the sequence_strings argument is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractBests(string = word, sequence_strings = NULL, processor = NULL, scorer = NULL, limit = 5L) )
})
testthat::test_that("the string argument is a character string", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractBests(string = 1, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = 5L) )
})
testthat::test_that("the sequence_strings argument is a character vector", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractBests(string = word, sequence_strings = 1, processor = NULL, scorer = NULL, limit = 5L) )
})
testthat::test_that("the processor argument is a function in case that is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$ExtractBests(string = word, sequence_strings = vec_getclose, processor = list(), scorer = SCOR, limit = 5L) )
})
testthat::test_that("the scorer argument is a function in case that is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$ExtractBests(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = list(), limit = 5L) )
})
init$ExtractBests(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, score_cutoff = '0L', limit = 5L)
testthat::test_that("the score_cutoff argument is a numeric value", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$ExtractBests(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, score_cutoff = '0L', limit = 5L) )
})
testthat::test_that("the limit argument is a numeric value", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$ExtractBests(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = '5L') )
})
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractBests(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = 5L)
res_lst
res_lst = init$ExtractBests(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = 1L)
res_lst
testthat::test_that("returns the expected output if scorer is NULL - processor takes default function", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractBests(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, limit = 1L)
testthat::expect_true( res_lst[[1]][[1]] == "Frodo Baggins" && res_lst[[1]][[2]] == 67 )
})
testthat::test_that("returns the expected output if scorer is not NULL - processor takes default function", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractBests(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = SCOR, limit = 5L)
testthat::expect_true( res_lst[[1]][[1]] == "Frodo Baggins" && res_lst[[1]][[2]] == 67 )
})
testthat::test_that("the string argument is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractWithoutOrder(string = NULL, processor = NULL, scorer = NULL) )
})
testthat::test_that("the sequence_strings argument is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractWithoutOrder(string = word, sequence_strings = NULL, processor = NULL, scorer = NULL) )
})
testthat::test_that("the string argument is a character string", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractWithoutOrder(string = 1, sequence_strings = vec_getclose, processor = NULL, scorer = NULL) )
})
testthat::test_that("the sequence_strings argument is a character vector", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractWithoutOrder(string = word, sequence_strings = 1, processor = NULL, scorer = NULL) )
})
testthat::test_that("the processor argument is a function in case that is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$ExtractWithoutOrder(string = word, sequence_strings = vec_getclose, processor = list(), scorer = SCOR) )
})
testthat::test_that("the scorer argument is a function in case that is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$ExtractWithoutOrder(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = list()) )
})
testthat::test_that("the score_cutoff argument is a numeric value", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$ExtractWithoutOrder(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, score_cutoff = '0L') )
})
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractWithoutOrder(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL)
res_lst
inherits(unlist(lapply(res_lst, function(x) x[[1]])), c('character', 'vector')) && inherits(unlist(lapply(res_lst, function(x) x[[2]])), c('integer', 'vector'))
testthat::test_that("returns the expected output if scorer is NULL - processor takes default function", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractWithoutOrder(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL)
testthat::expect_true( inherits(unlist(lapply(res_lst, function(x) x[[1]])), c('character', 'vector')) && inherits(unlist(lapply(res_lst, function(x) x[[2]])), c('integer', 'vector')) )
})
testthat::test_that("returns the expected output if scorer is not NULL - processor takes default function", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractWithoutOrder(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = SCOR)
testthat::expect_true( inherits(unlist(lapply(res_lst, function(x) x[[1]])), c('character', 'vector')) && inherits(unlist(lapply(res_lst, function(x) x[[2]])), c('integer', 'vector')) )
})
testthat::test_that("the string argument is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractOne(string = NULL, processor = NULL, scorer = NULL) )
})
testthat::test_that("the sequence_strings argument is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractOne(string = word, sequence_strings = NULL, processor = NULL, scorer = NULL) )
})
testthat::test_that("the string argument is a character string", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractOne(string = 1, sequence_strings = vec_getclose, processor = NULL, scorer = NULL) )
})
testthat::test_that("the sequence_strings argument is a character vector", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$ExtractOne(string = word, sequence_strings = 1, processor = NULL, scorer = NULL) )
})
testthat::test_that("the processor argument is a function in case that is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$ExtractOne(string = word, sequence_strings = vec_getclose, processor = list(), scorer = SCOR) )
})
testthat::test_that("the scorer argument is a function in case that is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$ExtractOne(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = list()) )
})
testthat::test_that("the score_cutoff argument is a numeric value", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$ExtractOne(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL, score_cutoff = '0L') )
})
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractOne(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL)
res_lst
testthat::test_that("returns the expected output if scorer is NULL - processor takes default function", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractOne(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL)
testthat::expect_true( res_lst[[1]][[1]] == "Frodo Baggins" && res_lst[[1]][[2]] == 67 )
})
testthat::test_that("returns the expected output if scorer is not NULL - processor takes default function", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractOne(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = SCOR)
testthat::expect_true( res_lst[[1]][[1]] == "Frodo Baggins" && res_lst[[1]][[2]] == 67)
})
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractOne(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL)
res_lst
res_lst[[1]] == "Frodo Baggins" && res_lst[[1]] == 67
res_lst
res_lst[[1]]
res_lst[[1]] == "Frodo Baggins"
testthat::test_that("returns the expected output if scorer is NULL - processor takes default function", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractOne(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = NULL)
testthat::expect_true( res_lst[[1]] == "Frodo Baggins" && res_lst[[2]] == 67 )
})
testthat::test_that("returns the expected output if scorer is not NULL - processor takes default function", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
res_lst = init$ExtractOne(string = word, sequence_strings = vec_getclose, processor = NULL, scorer = SCOR)
testthat::expect_true( res_lst[[1]] == "Frodo Baggins" && res_lst[[2]] == 67)
})
init = FuzzExtract$new()
init$Dedupe(contains_dupes = NULL, threshold = 70L, scorer = NULL)
init$Dedupe(contains_dupes = 1, threshold = 70L, scorer = NULL)
vec_getclose
init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = list())
testthat::test_that("the scorer argument is a function in case that is not NULL", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
init_scor = FuzzMatcher$new()
SCOR = init_scor$WRATIO
testthat::expect_error( init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = list()) )
})
init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = '70L', scorer = NULL)
testthat::test_that("the threshold argument is a numeric value", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_error( init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = '70L', scorer = NULL) )
})
init = FuzzExtract$new()
init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = NULL)
testthat::test_that("it returns the expected output", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_output( init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = NULL) )
})
a = init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = NULL)
a
str(a)
reticulate::py_str(a)
reticulate::py_str(init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = NULL)) == "dict_keys(['Frodo Baggins', 'Tom Sawyer', 'Bilbo Baggin'])"
testthat::test_that("it returns the expected output", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
testthat::expect_true( reticulate::py_str(init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = NULL)) == "dict_keys(['Frodo Baggins', 'Tom Sawyer', 'Bilbo Baggin'])" )
})
reticulate::py_to_r(a)
devtools::document(pkg = '/home/lampros/ADD_GITHUB/fuzzywuzzyR')
setwd('/home/lampros/ADD_GITHUB/')
system("R CMD build fuzzywuzzyR")
system("R CMD check --as-cran fuzzywuzzyR_0.1.0.tar.gz")
FUZZ <<- reticulate::import("fuzzywuzzy.fuzz", delay_load = TRUE) delay load foo module ( will only be loaded when accessed via $ )
DIFFLIB <<- reticulate::import("difflib", delay_load = TRUE)
EXTRACT <<- reticulate::import("fuzzywuzzy.process", delay_load = TRUE)
UTILS <<- reticulate::import("fuzzywuzzy.utils", delay_load = TRUE)
source('~/ADD_GITHUB/fuzzywuzzyR/R/fuzzy_w.R')
init = FuzzExtract$new()
reticulate::py_str(init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = NULL))
s1 = ' It was a dark and stormy night. I was all alone sitting on a red chair.'
s2 = ' It was a murky and stormy night. I was all alone sitting on a crimson chair.'
word = 'Fra Bagg'
vec_getclose = c('Frodo Baggins', 'Tom Sawyer', 'Bilbo Baggin')
st1 = "Atlanta Falcons"
st2 = "New York Jets"
reticulate::py_str(init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = NULL))
is.character(res_str)
res_str = reticulate::py_str(init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = NULL))
is.character(res_str)
length(res_str) > 0
testthat::test_that("it returns the expected output", {
skip_test_if_no_module("fuzzywuzzy.process")
init = FuzzExtract$new()
res_str = reticulate::py_str(init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = NULL))
testthat::expect_true( is.character(res_str) && length(res_str) > 0 )
})
init = FuzzExtract$new()
res_str = reticulate::py_str(init$Dedupe(contains_dupes = c(vec_getclose, "Bilbo Baggin"), threshold = 70L, scorer = NULL))
is.character(res_str) && length(res_str) > 0
setwd('/home/lampros/ADD_GITHUB/')
system("R CMD build fuzzywuzzyR")
system("R CMD check --as-cran fuzzywuzzyR_0.1.0.tar.gz")
system("R CMD INSTALL fuzzywuzzyR_0.1.0.tar.gz")
covr::shine(covr::package_coverage(path = '/home/lampros/ADD_GITHUB/fuzzywuzzyR', type = "tests", quiet = F))
install.packages("DT")
covr::shine(covr::package_coverage(path = '/home/lampros/ADD_GITHUB/fuzzywuzzyR', type = "tests", quiet = F))
covr::shine(covr::package_coverage(path = '/home/lampros/ADD_GITHUB/fuzzywuzzyR', type = "tests", quiet = F))
covr::package_coverage(path = '/home/lampros/Desktop/kaggle_gpu/add_GITHUB/textTinyR', type = "tests", quiet = F)
covr::package_coverage(path = '/home/lampros/ADD_GITHUB/fuzzywuzzyR', type = "tests", quiet = F)
system("R CMD INSTALL fuzzywuzzyR_0.1.0.tar.gz")
setwd('/home/lampros/ADD_GITHUB/')
system("R CMD INSTALL fuzzywuzzyR_0.1.0.tar.gz")
setwd('/home/lampros/Desktop/kaggle_gpu/add_GITHUB/')
system("R CMD build fuzzywuzzyR")
system("R CMD check --as-cran fuzzywuzzyR_1.0.0.tar.gz")
setwd('/home/lampros/Desktop/kaggle_gpu/add_GITHUB/')
system("R CMD build fuzzywuzzyR")
system("R CMD check --as-cran --use-valgrind fuzzywuzzyR_1.0.1.tar.gz")
word = "安广"
choices = c("安徽","安广")
init_proc = fuzzywuzzyR::FuzzUtils$new() initialization of FuzzUtils class to choose a processor
remove_special_chars = paste0(word, "%&$!")
PROC = init_proc$Full_process(string = remove_special_chars, decoding = 'utf-8') processor-method
PROC
remove_special_chars
init_scor = fuzzywuzzyR::FuzzMatcher$new(decoding = 'utf-8') 'utf-8' decoding applies to all methods of the 'FuzzMatcher' class
SCOR = init_scor$WRATIO choosen scorer function
init <- fuzzywuzzyR::FuzzExtract$new(decoding = 'utf-8') 'utf-8' decoding applies to all methods of the 'FuzzExtract' class
fzextr = init$Extract(string = word, sequence_strings = choices, scorer = SCOR)
fzextr

1.0.3

I added an exception in the additional tests, to avoid Solaris OS throw an error if python is not available

1.0.2

I added the *decoding* parameter to the following classes : *FuzzExtract*, *FuzzMatcher* and *FuzzUtils*. The *decoding* parameter does not apply to the *GetCloseMatches* and *SequenceMatcher* classes, because there isn't any *force_ascii* parameter in the *difflib* python library. The *decoding* parameter applies only to python 2 configurations, as in python 3 character strings are decoded to unicode by default.
For reference, see the following github issue : https://github.com/mlampros/fuzzywuzzyR/issues/3

1.0.1

I added links to the github repository (master repository, issues).

1.0.0

0.17.0

-------------------

- Make benchmarks script Py3 compatible. [Stefan Behnel]

- Add Go lang port. [iddober]

- Add reference to C port. [ericcoleman]

- Chore: remove license header from files. [Jose Diaz-Gonzalez]

The files should all inherit the projects license.


- Fix README title style. [Thomas Grainger]

- Add readme check. [Thomas Grainger]

install docutils and Pygments


- Cache pip. [Thomas Grainger]

- Upgrade pip/setuptools for hypothesis. [Thomas Grainger]

- Feat: drop py26 and py33 support from tox. [Jose Diaz-Gonzalez]

- Feat: drop support for 2.6 in test_fuzzywuzzy.py. [Jose Diaz-Gonzalez]

- Feat: drop reference to 2.4 from readme. [Jose Diaz-Gonzalez]

- Feat: drop py2.6 and py3.3 classifiers. [Jose Diaz-Gonzalez]

- Feat: drop 2.6 and 3.3 support. [Jose Diaz-Gonzalez]

These are no longer supported. Please upgrade your python version if you are using either version.

- Fuzz: _token_sort: check for equivalence. [Ralf Ramsauer]

If we don't have to full_process the strings, we can safely assume to
return 100 in case both candidates equal.

Signed-off-by: Ralf Ramsauer <ralf.ramsaueroth-regensburg.de>


- Test: add more test cases. [Ralf Ramsauer]

Signed-off-by: Ralf Ramsauer <ralf.ramsaueroth-regensburg.de>


- Utils: add and use check_for_equivalence decorator. [Ralf Ramsauer]

And decorate basic scoring functions.

The check_for_equivalence decorator MUST be used after the
check_for_none decorator, as otherwise ratio(None, None) will get a
score of 100.

This fixes the first part of the recently introduced changes in the test
set.

Signed-off-by: Ralf Ramsauer <ralf.ramsaueroth-regensburg.de>


- Tests: add some corner cases. [Ralf Ramsauer]

'' and '' are equal, so are '{' and '{'. Test if fuzzywuzzy gives them a
score of 100.

For the moment, this patch breaks tests, fixes in fuzzywuzzy follow.

Signed-off-by: Ralf Ramsauer <ralf.ramsaueroth-regensburg.de>


- Utils: remove superfluous check. [Ralf Ramsauer]

Decorators make sure that only non None-values are passed. We can safely
assume that None will never get here.

Other than that, None's shouldn't simply be ignored and erroneously
changed to empty strings. Better let users fail.

This commit doesn't break any tests.

Signed-off-by: Ralf Ramsauer <ralf.ramsaueroth-regensburg.de>


- README: add missing requirements. [Ralf Ramsauer]

pycodestyle and hypothesis are required for automatic testing. Add them
to README's requirement section.

Signed-off-by: Ralf Ramsauer <ralf.ramsaueroth-regensburg.de>


- Remove empty document. [Ralf Ramsauer]

Signed-off-by: Ralf Ramsauer <ralf.ramsaueroth-regensburg.de>

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.