File: phonetic.Rd

package info (click to toggle)
r-cran-stringdist 0.9.15-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,424 kB
  • sloc: ansic: 1,690; sh: 13; makefile: 2
file content (52 lines) | stat: -rw-r--r-- 1,940 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/phonetic.R
\name{phonetic}
\alias{phonetic}
\title{Phonetic algorithms}
\usage{
phonetic(x, method = c("soundex"), useBytes = FALSE)
}
\arguments{
\item{x}{a character vector whose elements are phonetically encoded.}

\item{method}{name of the algorithm used. The default is \code{"soundex"}.}

\item{useBytes}{Perform byte-wise comparison. \code{useBytes=TRUE} is faster 
but may yield different results depending on character encoding. For more
information see the documentation of \code{\link{stringdist}}.}
}
\value{
The returns value depends on the method used. However, all currently 
implemented methods return a character vector of the same length of the input
vector. Output characters are in the system's native encoding.
}
\description{
Translate strings to phonetic codes. Similar sounding strings should get 
similar or equal codes.
}
\details{
Currently, only the soundex algorithm is implemented. Note that soundex coding
is only meaningful for characters in the ranges a-z and A-Z. Soundex coding of strings 
containing non-printable ascii or non-ascii characters may be system-dependent and should 
not be trusted. If non-ascii or non-printable ascii charcters are encountered, a warning 
is emitted.
}
\examples{
# The following examples are from The Art of Computer Programming (part III, p. 395)
# (Note that our algorithm is specified different from the one in TACP, see references.)
phonetic(c('Euler','Gauss','Hilbert','Knuth','Lloyd','Lukasiewicz','Wachs'),method='soundex')


}
\references{
\itemize{
\item{The Soundex algorithm implemented is the algorithm used by the 
  \href{https://www.archives.gov/research/census/soundex}{National Archives}. 
  This algorithm differs slightly from the original algorithm patented by R.C. Russell 
  (US patents 1261167 (1918) and 1435663 (1922)). 
}
}
}
\seealso{
\code{\link{printable_ascii}}
}