Skip to content

Commit 81b815b

Browse files
committed
Fix numerous spelling mistakes
1 parent 83a2ebb commit 81b815b

27 files changed

+71
-71
lines changed

R/casechange-functions.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#' Convert the case of tokens
22
#'
33
#' \code{tokens_tolower} and \code{tokens_toupper} convert the features of a
4-
#' \link{tokens} object and reindex the types.
4+
#' \link{tokens} object and re-index the types.
55
#' @inheritParams char_tolower
66
#' @importFrom stringi stri_trans_tolower
77
#' @export

R/corpus_trim.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ char_trim.character <- function(x, what = c("sentences", "paragraphs", "document
106106
#' a tokenized set of sentences if . If the input was a corpus, then the all
107107
#' docvars and metadata are preserved. For documents whose sentences have
108108
#' been removed entirely, a null string (\code{""}) will be returned.
109-
#' @note This function has been superceded by \code{\link{corpus_trim}}; use
109+
#' @note This function has been superseded by \code{\link{corpus_trim}}; use
110110
#' that function instead.
111111
#' @export
112112
#' @keywords internal deprecated

R/dfm-methods.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ as.dfm.TermDocumentMatrix <- function(x){
140140
dimnames = list(colnames(x), rownames(x))))
141141
}
142142

143-
#' Conversts a Matrix to a dfm
143+
#' Converts a Matrix to a dfm
144144
#' @param x a Matrix
145145
#' @param slots slots a list of values to be assigned to slots
146146
#' @keywords internal

R/dfm.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
#' @param verbose display messages if \code{TRUE}
3636
#' @param ... additional arguments passed to \link{tokens}; not used when \code{x}
3737
#' is a \link{dfm}
38-
#' @details The default behavior for \code{remove}/\code{select} when
38+
#' @details The default behaviour for \code{remove}/\code{select} when
3939
#' constructing ngrams using \code{dfm(x, } \emph{ngrams > 1}\code{)} is to
4040
#' remove/select any ngram constructed from a matching feature. If you wish
4141
#' to remove these before constructing ngrams, you will need to first tokenize

R/dfm_trim.R

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@
1616
#' across all documents, below/above which features will
1717
#' be removed
1818
#' @param termfreq_type how \code{min_termfreq} and \code{max_termfreq} are
19-
#' intepreted. \code{"count"} sums the frequencies; \code{"prop"} devides the
20-
#' term frequences by the total sum; \code{"rank"} is matched against the inverted
21-
#' ranking of features in terms of overall frequency, so that 1, 2, ... are
22-
#' the highest and second highest frequency features, and so on;
19+
#' intepreted. \code{"count"} sums the frequencies; \code{"prop"} divides the
20+
#' term frequencies by the total sum; \code{"rank"} is matched against the
21+
#' inverted ranking of features in terms of overall frequency, so that 1, 2,
22+
#' ... are the highest and second highest frequency features, and so on;
2323
#' \code{"quantile"} sets the cutoffs according to the quantiles (see
2424
#' \code{\link{quantile}}) of term frequencies.
2525
#' @param min_docfreq,max_docfreq minimum/maximum values of a feature's document
2626
#' frequency, below/above which features will be removed
2727
#' @param docfreq_type specify how \code{min_docfreq} and \code{max_docfreq} are
28-
#' intepreted. \code{"count"} is the same as \code{\link{docfreq}(x, scheme
29-
#' = "count")}; \code{"prop"} devides the document frequences by the total sum;
30-
#' \code{"rank"} is matched against the inverted ranking of document
28+
#' interpreted. \code{"count"} is the same as \code{\link{docfreq}(x, scheme
29+
#' = "count")}; \code{"prop"} divides the document frequencies by the total
30+
#' sum; \code{"rank"} is matched against the inverted ranking of document
3131
#' frequency, so that 1, 2, ... are the features with the highest and second
3232
#' highest document frequencies, and so on; \code{"quantile"} sets the cutoffs
3333
#' according to the quantiles (see \code{\link{quantile}}) of document

R/dfm_weight.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
#' cat("\n\n=== weight() TEST for:", w, "; class:", class(testw), "\n")
6666
#' head(testw)
6767
#' }}
68-
#' @references Manning, Christopher D., Prabhakar Raghavan, and Hinrich Schutze.
68+
#' @references Manning, Christopher D., Prabhakar Raghavan, and Hinrich Schütze.
6969
#' \emph{Introduction to Information Retrieval}. Vol. 1. Cambridge: Cambridge
7070
#' University Press, 2008.
7171
dfm_weight <- function(
@@ -259,7 +259,7 @@ dfm_smooth.dfm <- function(x, smoothing = 1) {
259259
#' prevent a zero document count for a term
260260
#' @param base the base with respect to which logarithms in the inverse document
261261
#' frequency weightings are computed; default is 10 (see Manning,
262-
#' Raghavan, and Schutze 2008, p123).
262+
#' Raghavan, and Schütze 2008, p123).
263263
#' @param threshold numeric value of the threshold \emph{above which} a feature
264264
#' will considered in the computation of document frequency. The default is
265265
#' 0, meaning that a feature's document frequency will be the number of
@@ -290,7 +290,7 @@ dfm_smooth.dfm <- function(x, smoothing = 1) {
290290
#' docfreq(wiki_dfm, scheme = "unary")
291291
#' docfreq(wiki_dfm, scheme = "inversemax")
292292
#' docfreq(wiki_dfm, scheme = "inverseprob")
293-
#' @references Manning, C. D., Raghavan, P., & Schutze, H. (2008).
293+
#' @references Manning, C. D., Raghavan, P., & Schütze, H. (2008).
294294
#' \emph{Introduction to Information Retrieval}. Cambridge University Press.
295295
docfreq <- function(x, scheme = c("count", "inverse", "inversemax",
296296
"inverseprob", "unary"),
@@ -371,7 +371,7 @@ docfreq.dfm <- function(x, scheme = c("count", "inverse", "inversemax",
371371
#' weighting. The default is to use counts instead of normalized term
372372
#' frequency (the relative term frequency within document), but this
373373
#' can be overridden using \code{scheme_tf = "prop"}.
374-
#' @references Manning, C. D., Raghavan, P., & Schutze, H. (2008).
374+
#' @references Manning, C. D., Raghavan, P., & Schütze, H. (2008).
375375
#' \emph{Introduction to Information Retrieval}. Cambridge University Press.
376376
#' @seealso \code{\link{dfm_weight}}, \code{\link{docfreq}}
377377
#' @keywords dfm weighting

R/fcm-methods.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ as.fcm <- function(x) {
166166
matrix2fcm(x)
167167
}
168168

169-
#' Conversts a Matrix to a fcm
169+
#' Converts a Matrix to a fcm
170170
#' @param x a Matrix
171171
#' @param slots slots a list of values to be assigned to slots
172172
#' @keywords internal

R/textmodel_wordscores.R

+2-2
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ textmodel_wordscores.dfm <- function(x, y, scale = c("linear", "logit"), smooth
124124
#' @param level tolerance/confidence level for intervals
125125
#' @param force make the feature set of \code{newdata} conform to the model
126126
#' terms. The default of \code{TRUE} means that a fitted model can be applied
127-
#' to scale a dfm that doesn't contain a 1:1 match of features in the training
128-
#' and prediction data.
127+
#' to scale a dfm that does not contain a 1:1 match of features in the
128+
#' training and prediction data.
129129
#' @param ... not used
130130
#' @return
131131
#' \code{predict.textmodel_wordscores()} returns a named vector of predicted

R/textplot_wordcloud.R

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
#' dropped.
2222
#' @param color color of words from least to most frequent
2323
#' @param font font-family of words and labels. Use default font if \code{NULL}.
24-
#' @param adjust ajust sizes of words by a constant. Useful for non-Engish words
25-
#' for which R fails to obtain correct sizes.
24+
#' @param adjust adjust sizes of words by a constant. Useful for non-English
25+
#' words for which R fails to obtain correct sizes.
2626
#' @param rotation proportion of words with 90 degree rotation
2727
#' @param random_order plot words in random order. If \code{FALSE}, they will be
2828
#' plotted in decreasing frequency.
@@ -36,8 +36,8 @@
3636
#' \code{comparison=TRUE}.
3737
#' @param fixed_aspect if \code{TRUE}, the aspect ratio is fixed. Variable
3838
#' aspect ratio only supported if rotation = 0.
39-
#' @param comparison if \code{TRUE}, plot a wordclound that compares documents
40-
#' in the same way as \code{\link[wordcloud]{comparison.cloud}}
39+
#' @param comparison if \code{TRUE}, plot a wordcloud that compares documents in
40+
#' the same way as \code{\link[wordcloud]{comparison.cloud}}
4141
#' @param ... additional parameters. Only used to make it compatible with
4242
#' \pkg{wordcloud}
4343
#' @examples
@@ -140,7 +140,7 @@ textplot_wordcloud.dfm <- function(x,
140140

141141
#' Internal function for textplot_wordcloud
142142
#'
143-
#' This function impliments wordcloud without dependecies. Code is adopted from
143+
#' This function implements wordcloud without dependencies. Code is adopted from
144144
#' \code{\link[wordcloud]{wordcloud}}.
145145
#' @inheritParams textplot_wordcloud
146146
#' @param scale deprecated argument
@@ -153,7 +153,7 @@ textplot_wordcloud.dfm <- function(x,
153153
#' @param use.r.layout deprecated argument
154154
#' @param fixed.asp deprecated argument
155155
#' @keywords internal
156-
#' @author Kohei Watanabe, builting on code from Ian Fellows's \pkg{wordcloud} package.
156+
#' @author Kohei Watanabe, building on code from Ian Fellows's \pkg{wordcloud} package.
157157
wordcloud <- function(x, min_size, max_size, min_count, max_words,
158158
color, font, adjust, rotation,
159159
random_order, random_color, ordered_color,
@@ -309,8 +309,8 @@ wordcloud <- function(x, min_size, max_size, min_count, max_words,
309309

310310
#' Internal function for textplot_wordcloud
311311
#'
312-
#' This function impliments wordcloud that compares documents. Code is adopted from
313-
#' \code{\link[wordcloud]{comparison.cloud}}.
312+
#' This function implements wordcloud that compares documents. Code is adopted
313+
#' from \code{\link[wordcloud]{comparison.cloud}}.
314314
#' @inheritParams textplot_wordcloud
315315
#' @param scale deprecated argument
316316
#' @param min.freq deprecated argument

R/tokens.R

+4-4
Original file line numberDiff line numberDiff line change
@@ -769,10 +769,10 @@ tokens_character <- function(txt,
769769
#' This function recompiles a serialized tokens object when the vocabulary has
770770
#' been changed in a way that makes some of its types identical, such as
771771
#' lowercasing when a lowercased version of the type already exists in the type
772-
#' table, or introduces gaps in the integer map of the types. It also reindexes
773-
#' the types attribute to account for types that may have become duplicates,
774-
#' through a procedure such as stemming or lowercasing; or the addition of new
775-
#' tokens through compounding.
772+
#' table, or introduces gaps in the integer map of the types. It also
773+
#' re-indexes the types attribute to account for types that may have become
774+
#' duplicates, through a procedure such as stemming or lowercasing; or the
775+
#' addition of new tokens through compounding.
776776
#' @param x the \link{tokens} object to be recompiled
777777
#' @param gap if \code{TRUE}, remove gaps between token IDs
778778
#' @param dup if \code{TRUE}, merge duplicated token types into the same ID

R/utils.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ unused_dots <- function(...) {
230230

231231

232232
#' Return an error message
233-
#' @param key type of erro message
233+
#' @param key type of error message
234234
#' @keywords internal
235235
message_error <- function(key = NULL) {
236236
msg <- c("dfm_empty" = "dfm must have at least one non-zero value",

man/corpus_trimsentences.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/dfm.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/dfm_tfidf.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/dfm_trim.Rd

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/dfm_weight.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/docfreq.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/matrix2dfm.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/matrix2fcm.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/message_error.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/predict.textmodel_wordscores.Rd

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/textplot_wordcloud.Rd

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/tokens_recompile.Rd

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/tokens_tolower.Rd

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/wordcloud.Rd

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)