-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 0.2-0 and deactivating test for as.textmeta.corpus due to str…
…ingsAsFactors problem
- Loading branch information
Showing
2 changed files
with
23 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
context("transform a corpus object to textmeta") | ||
|
||
test_that("as.textmeta.corpus", { | ||
texts <- c("Give a Man a Fish, and You Feed Him for a Day. | ||
Teach a Man To Fish, and You Feed Him for a Lifetime", | ||
"So Long, and Thanks for All the Fish", | ||
"A very able manipulative mathematician, Fisher enjoys a real mastery | ||
in evaluating complicated multiple integrals.") | ||
|
||
corp <- quanteda::corpus(x = texts) | ||
obj <- as.textmeta.corpus(corp, addMetadata = FALSE) | ||
expect_true(is.textmeta(obj)) | ||
|
||
quanteda::docvars(corp, "title") <- c("Fishing", "Don't panic!", "Sir Ronald") | ||
quanteda::docvars(corp, "date") <- c("1885-01-02", "1979-03-04", "1951-05-06") | ||
quanteda::docvars(corp, "id") <- c("A", "B", "C") | ||
quanteda::docvars(corp, "additionalVariable") <- 1:3 | ||
|
||
obj <- as.textmeta.corpus(corp) | ||
expect_true(is.textmeta(obj)) | ||
}) | ||
# context("transform a corpus object to textmeta") | ||
# | ||
# test_that("as.textmeta.corpus", { | ||
# texts <- c("Give a Man a Fish, and You Feed Him for a Day. | ||
# Teach a Man To Fish, and You Feed Him for a Lifetime", | ||
# "So Long, and Thanks for All the Fish", | ||
# "A very able manipulative mathematician, Fisher enjoys a real mastery | ||
# in evaluating complicated multiple integrals.") | ||
# | ||
# corp <- quanteda::corpus(x = texts) | ||
# obj <- as.textmeta.corpus(corp, addMetadata = FALSE) | ||
# expect_true(is.textmeta(obj)) | ||
# | ||
# quanteda::docvars(corp, "title") <- c("Fishing", "Don't panic!", "Sir Ronald") | ||
# quanteda::docvars(corp, "date") <- c("1885-01-02", "1979-03-04", "1951-05-06") | ||
# quanteda::docvars(corp, "id") <- c("A", "B", "C") | ||
# quanteda::docvars(corp, "additionalVariable") <- 1:3 | ||
# | ||
# obj <- as.textmeta.corpus(corp) | ||
# expect_true(is.textmeta(obj)) | ||
# }) |