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 (#50)
Browse files Browse the repository at this point in the history
* Update DESCRIPTION and add spelling check ref #27

* Fix typo and bump ver [no ci]
  • Loading branch information
chainsawriot authored Nov 22, 2023
1 parent 8ef2ba5 commit b12f4d2
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 7 deletions.
9 changes: 6 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
Package: quanteda.proximity
Title: Proximity-based Weighting Scheme for the Quantitative Analysis of Textual Data
Version: 0.0.0.9000
Version: 0.0.1
Authors@R:
c(person("Chung-hong", "Chan", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0002-6232-7530")),
person("David", "Schoch", , "[email protected]", role = c("aut"),
comment = c(ORCID = "0000-0003-2952-4812"))
)
Description: Extract the promixty between words and use the information to weight the frequency information in a Document-Feature Matrix.
Description: Extract the proximity among words and use the information to weight the frequency information in a Document-Feature Matrix.
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 b12f4d2

Please sign in to comment.