Skip to content

Commit

Permalink
fixing doucmentationf for and
Browse files Browse the repository at this point in the history
  • Loading branch information
beniaminogreen committed Feb 17, 2024
1 parent 5774928 commit c71faa5
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
2 changes: 1 addition & 1 deletion R/hamming_join_core.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ hamming_join <- function(a, b, mode, by, n_bands, band_width,
if (!is.null(similarity_column)) {
similarities <- hamming_distance(
pull(a[match_table[, 1], ], by_a),
pull(b[match_table[, 2], ], by_b),
pull(b[match_table[, 2], ], by_b)
)
}

Expand Down
3 changes: 3 additions & 0 deletions R/lsh_properties.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ jaccard_hyper_grid_search <- function(s1 = .1, s2 = .7, p1 = .001, p2 = .999) {
#'
#' @param n_bands The number of LSH bands used in hashing.
#'
#' @param imput_length the length (number of characters) of the input strings
#' you want to calculate.
#'
#' @param band_width The number of hashes in each band.
#'
#' @return A decimal number giving the probability that the two items will be
Expand Down
6 changes: 3 additions & 3 deletions R/jaccard_similarity.R → R/string_similarities.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ jaccard_similarity <- function(a, b, ngram_width = 2) {
#'
#' @examples
#' hamming_distance(
#' c("the quick brown fox", "jumped over the lazy dog"),
#' c("the quck bron fx", "jumped over hte lazy dog")
#' c("ACGTCGATGACGTGATGCGTAGCGTA", "ACGTCGATGTGCTCTCGTCGATCTAC"),
#' c("ACGTCGACGACGTGATGCGCAGCGTA", "ACGTCGATGGGGTCTCGTCGATCTAC")
#' )
#'
#' @export
hamming_distance <- function(a, b, ngram_width = 2) {
hamming_distance <- function(a, b) {
stopifnot(length(a) == length(b))
rust_hamming_distance(a, b)
}
8 changes: 4 additions & 4 deletions man/hamming_distance.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/hamming_probability.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/jaccard_similarity.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c71faa5

Please sign in to comment.