Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteb07072

Browse files
committed
doc update
1 parent352c61f commiteb07072

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

‎pkg/R/afind.R‎

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
#' Stringdist-based fuzzy text search
22
#'
33
#' \code{afind} slides a window of fixed width over a string \code{x} and
4-
#' computes the distance between thecurrent window and the sought-after
4+
#' computes the distance between theeach window and the sought-after
55
#' \code{pattern}. The location, content, and distance corresponding to the
66
#' window with the best match is returned.
77
#'
88
#'
9-
#' @param x \code{[character]} strings to search in
10-
#' @param pattern \code{[character]} strings to find (not a regular expression).
11-
#' @param window \code{[integer]} width of moving window
12-
#' @param value \code{[logical]} toggle return matrix with matched strings.
9+
#' @param x strings to search in
10+
#' @param pattern strings to find (not a regular expression). For \code{grab},
11+
#' \code{grabl}, and \code{extract} this must be a single string.
12+
#' @param window width of moving window.
13+
#' @param value toggle return matrix with matched strings.
1314
#' @inheritParams amatch
1415
#'
1516
#' @details
@@ -39,8 +40,10 @@
3940
#'
4041
#'
4142
#' @return
42-
#' For \code{afind} A \code{list} of three matrices, each of with \code{length(x)} rows and \code{length(pattern)}
43-
#' columns. In each matrix, element \eqn{(i,j)} corresponds to \code{x[i]} and \code{pattern[j]}.
43+
#' For \code{afind}: a \code{list} of three matrices, each with
44+
#' \code{length(x)} rows and \code{length(pattern)} columns. In each matrix,
45+
#' element \eqn{(i,j)} corresponds to \code{x[i]} and \code{pattern[j]}. The
46+
#' names and description of each matrix is as follows.
4447
#' \itemize{
4548
#' \item{\code{location}. \code{[integer]}, location of the start of best matching window.
4649
#' When \code{useBytes=FALSE}, this corresponds to the location of a \code{UTF} code point
@@ -60,7 +63,10 @@
6063
#' , "I want to be a fisherman")
6164
#' patterns = c("fish", "gone","to be")
6265
#'
63-
#' afind(texts, patterns, method="cosine", q=3)
66+
#' afind(texts, patterns, method="running_cosine", q=3)
67+
#'
68+
#' grabl(texts,"grew", maxDist=1)
69+
#' extract(texts, "harvested", maxDist=3)
6470
#'
6571
#'
6672
#' @export

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp