Skip to content
This repository has been archived by the owner on Feb 11, 2024. It is now read-only.

Commit

Permalink
Update DESCRIPTION and add spelling check ref #27
Browse files Browse the repository at this point in the history
  • Loading branch information
chainsawriot committed Nov 22, 2023
1 parent 8ef2ba5 commit b2461ed
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 5 deletions.
5 changes: 4 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ License: GPL (>= 3)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Suggests:
URL: https://github.com/gesistsa/quanteda.proximity/, https://quanteda.io/
Suggests:
spelling,
knitr,
rmarkdown,
testthat (>= 3.0.0)
Expand All @@ -21,3 +23,4 @@ Imports:
quanteda,
Matrix
VignetteBuilder: knitr
Language: en-GB
2 changes: 1 addition & 1 deletion R/get_dist.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ pp <- function(pattern) {
#' @param tolower logical, convert all features to lowercase.
#' @param keep_acronyms logical, if `TRUE`, do not lowercase any all-uppercase words. See [quanteda::tokens_tolower()].
#' @details Proximity is measured by the number of tokens away from the keyword. Given a tokenized sentence: \["I", "eat", "this", "apple"\] and suppose "eat" is the keyword. The vector of minimum proximity for each word from "eat" is \[2, 1, 2, 3\], if `count_from` is 1. In another case: \["I", "wash", "and", "eat", "this", "apple"\] and \["wash", "eat"\] are the keywords. The minimal distance vector is \[2, 1, 2, 1, 2, 3\]. If `get_min` is `FALSE`, the output is a list of two vectors. For "wash", the distance vector is \[1, 0, 1, 2, 3\]. For "eat", \[3, 2, 1, 0, 1, 2\].
#' Please conduct all text maniputation tasks with `tokens_*()` functions before calling this function. To convert the output back to a `tokens` object, use [quanteda::as.tokens()].
#' Please conduct all text manipulation tasks with `tokens_*()` functions before calling this function. To convert the output back to a `tokens` object, use [quanteda::as.tokens()].
#' @return a `tokens_with_proximity` object. It is similar to [quanteda::tokens()], but only [dfm.tokens_with_proximity()], [quanteda::convert()], [quanteda::docvars()], and [quanteda::meta()] methods are available. A `tokens_with_proximity` has a modified [print()] method. Also, additional data slots are included
#' * a document variable `proximity`
#' * metadata slots for all arguments used
Expand Down
2 changes: 1 addition & 1 deletion README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,5 @@ dfm(tok4) %>% dfm_lookup(dict1) %>% rowSums()

# Similar functions

* [quanteda](https://quanteda.io/): `quanteda::tokens_select(window)`, `quanteda::fcm()`
* [quanteda](https://quanteda.io/): `quanteda::tokens_select(window)`, `quanteda::fcm()`, `quanteda::index()`
* [qdap](https://trinker.github.io/qdap): `qdap::word_proximity()`, `qdap::weight()`
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,6 @@ dfm(tok4) %>% dfm_lookup(dict1) %>% rowSums()
# Similar functions

- [quanteda](https://quanteda.io/): `quanteda::tokens_select(window)`,
`quanteda::fcm()`
`quanteda::fcm()`, `quanteda::index()`
- [qdap](https://trinker.github.io/qdap): `qdap::word_proximity()`,
`qdap::weight()`
8 changes: 8 additions & 0 deletions inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
CMD
Hamas
Lexicoder
Soroka
ameri
qdap
quanteda
valuetype
2 changes: 1 addition & 1 deletion man/tokens_proximity.Rd

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

3 changes: 3 additions & 0 deletions tests/spelling.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
if(requireNamespace('spelling', quietly = TRUE))
spelling::spell_check_test(vignettes = TRUE, error = FALSE,
skip_on_cran = TRUE)

0 comments on commit b2461ed

Please sign in to comment.