Skip to content

Commit

Permalink
v 1.1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
agricolamz committed Aug 23, 2023
1 parent d474910 commit 553c244
Show file tree
Hide file tree
Showing 29 changed files with 64 additions and 40 deletions.
3 changes: 2 additions & 1 deletion R/is.glottolog.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
#' is.glottolog(c('Adyghe', 'Russian'))
#' is.glottolog('Buyaka')
#'
#' \dontrun{
#' # Add warning message with sugestions
#' is.glottolog(c('Adygey', 'Russian'), response = TRUE)
#' # > FALSE TRUE
#' # Warning message:
#' # In is.glottolog(c('Adyge', 'Russian'), response = TRUE) :
#' # Language Adyge is absent in our version of the Glottolog database. Did you mean Aduge, Adyghe?
#'
#' }
#' @export
#' @importFrom stringdist stringdist
#'
Expand Down
40 changes: 8 additions & 32 deletions codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"codeRepository": "https://github.com/ropensci/lingtypology/",
"issueTracker": "https://github.com/ropensci/lingtypology/issues",
"license": "https://spdx.org/licenses/GPL-2.0",
"version": "1.1.9",
"version": "1.1.15",
"programmingLanguage": {
"@type": "ComputerLanguage",
"name": "R",
"url": "https://r-project.org"
},
"runtimePlatform": "R version 4.1.2 (2021-11-01)",
"runtimePlatform": "R version 4.3.1 (2023-06-16)",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
Expand Down Expand Up @@ -51,8 +51,8 @@
},
{
"@type": "Person",
"givenName": "Sasha",
"familyName": "Shakhnova"
"givenName": "Ekaterina",
"familyName": "Zalivina"
}
],
"maintainer": [
Expand Down Expand Up @@ -139,39 +139,15 @@
},
{
"@type": "SoftwareApplication",
"identifier": "rgeos",
"name": "rgeos",
"identifier": "sf",
"name": "sf",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rgeos"
},
{
"@type": "SoftwareApplication",
"identifier": "rgdal",
"name": "rgdal",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=rgdal"
},
{
"@type": "SoftwareApplication",
"identifier": "ggplot2",
"name": "ggplot2",
"provider": {
"@id": "https://cran.r-project.org",
"@type": "Organization",
"name": "Comprehensive R Archive Network (CRAN)",
"url": "https://cran.r-project.org"
},
"sameAs": "https://CRAN.R-project.org/package=ggplot2"
"sameAs": "https://CRAN.R-project.org/package=sf"
},
{
"@type": "SoftwareApplication",
Expand Down Expand Up @@ -258,7 +234,7 @@
},
"SystemRequirements": null
},
"fileSize": "2377.359KB",
"fileSize": "2227.264KB",
"citation": [
{
"@type": "SoftwareSourceCode",
Expand Down
3 changes: 2 additions & 1 deletion man/is.glottolog.Rd

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

1 change: 1 addition & 0 deletions tests/testthat/test-abvd-feature.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
library(lingtypology)

test_that("abvd.feature", {
skip_on_cran()
expect_error(abvd.feature(c("aa", "bb")), "You need to provide a numeric vector with language id from ABVD.")
})
1 change: 1 addition & 0 deletions tests/testthat/test-afbo-feature.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ library(lingtypology)
context("Tests for afbo.feature function")

test_that("afbo.feature", {
skip_on_cran()
expect_error(afbo.feature(c("aa", "bb")), "There is no features 'aa', 'bb' in AfBo database.")
})

1 change: 1 addition & 0 deletions tests/testthat/test-aff-lang.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
df <- data.frame(my_langs = c("Korean", "Polish"), stringsAsFactors = FALSE)

test_that("aff.lang", {
skip_on_cran()
expect_equal(aff.lang("Korean"), c(Korean = "Koreanic"))
expect_equal(aff.lang(c("Korean", "Polish")), c(Korean = "Koreanic", Polish = "Indo-European, Classical Indo-European, Balto-Slavic, Slavic, West Slavic, Lechitic, Polish-Silesian"))
expect_equal(aff.lang(df), c(my_langs1 = "Koreanic", my_langs2 = "Indo-European, Classical Indo-European, Balto-Slavic, Slavic, West Slavic, Lechitic, Polish-Silesian"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-area-lang.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ context("Tests for area.lang function")
df <- data.frame(my_langs = c("Korean", "Polish"), stringsAsFactors = FALSE)

test_that("area.lang", {
skip_on_cran()
expect_equal(area.lang("Adyghe"), c(Adyghe = "Eurasia"))
expect_equal(area.lang(c("Adyghe", "Aduge")), c(Adyghe = "Eurasia", Aduge = "Africa"))
expect_equal(area.lang(df), c(my_langs1 = "Eurasia", my_langs2 = "Eurasia"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-bantu-feature.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ library(lingtypology)
context("Tests for bantu.feature function")

test_that("bantu.feature", {
skip_on_cran()
expect_error(bantu.feature("aa"), "There is no features 'aa' in bantu database.")
})
1 change: 1 addition & 0 deletions tests/testthat/test-country-lang.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
df <- data.frame(my_langs = c("Korean", "Polish"), stringsAsFactors = FALSE)

test_that("country.lang", {
skip_on_cran()
expect_equal(country.lang("Korean"), c(Korean = "China;South Korea;North Korea;Russia"))
expect_equal(country.lang(c("Korean", "Polish")), c(Korean = "China;South Korea;North Korea;Russia", Polish = "Belarus;Czech;Germany;Lithuania;Poland;Russia"))
expect_equal(country.lang(df), c(my_langs1 = "China;South Korea;North Korea;Russia", my_langs2 = "Belarus;Czech;Germany;Lithuania;Poland;Russia"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-eurasianphonology-feature.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ library(testthat)
context("Tests for eurasianphonology.feature function")

test_that("eurasianphonology.feature", {
skip_on_cran()
expect_length(eurasianphonology.feature(), 19)})
12 changes: 7 additions & 5 deletions tests/testthat/test-glottolog-database.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ library(lingtypology)
context("Tests for is.glottolog function")

test_that("database part", {
expect_equal(is.glottolog("Adyghe"), TRUE)
skip_on_cran()
expect_equal(is.glottolog("Adyghe"), TRUE)
})

test_that("is.glottolog spell checker", {
expect_that(warning(is.glottolog("Adyge")), gives_warning())
expect_that(warning(is.glottolog("Adyge", response = TRUE)), gives_warning("Language Adyge is absent in our version of the Glottolog database. Did you mean Aduge, Adyghe, Abkhaz-Adyge?"))
expect_that(warning(is.glottolog("Romagnolo", response = TRUE)), gives_warning("Language Romagnolo is absent in our version of the Glottolog database. Did you mean Romagnol?"))
expect_that(warning(is.glottolog(c("Adyge", "Laz"), response = TRUE)), gives_warning("Language Adyge is absent in our version of the Glottolog database. Did you mean Aduge, Adyghe, Abkhaz-Adyge?"))
skip_on_cran()
expect_that(warning(is.glottolog("Adyge")), gives_warning())
expect_that(warning(is.glottolog("Adyge", response = TRUE)), gives_warning("Language Adyge is absent in our version of the Glottolog database. Did you mean Aduge, Adyghe, Abkhaz-Adyge?"))
expect_that(warning(is.glottolog("Romagnolo", response = TRUE)), gives_warning("Language Romagnolo is absent in our version of the Glottolog database. Did you mean Romagnol?"))
expect_that(warning(is.glottolog(c("Adyge", "Laz"), response = TRUE)), gives_warning("Language Adyge is absent in our version of the Glottolog database. Did you mean Aduge, Adyghe, Abkhaz-Adyge?"))
})
1 change: 1 addition & 0 deletions tests/testthat/test-gltc-iso.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ context("Tests for iso.gltc function")
df <- data.frame(my_langs = c("ady", "udi"), stringsAsFactors = FALSE)

test_that("iso.gltc", {
skip_on_cran()
expect_equal(gltc.iso("ady"), c(ady = "adyg1241"))
expect_equal(gltc.iso(c("ady", "udi")), c(ady = "adyg1241", udi = "udii1243"))
expect_equal(gltc.iso(df), c(my_langs1 = "adyg1241", my_langs2 = "udii1243"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-gltc-lang.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ context("Tests for gltc.lang function")
df <- data.frame(my_langs = c("Adyghe", "Udi"), stringsAsFactors = FALSE)

test_that("gltc.lang", {
skip_on_cran()
expect_equal(gltc.lang("Adyghe"), c(Adyghe = "adyg1241"))
expect_equal(gltc.lang(c("Adyghe", "Udi")), c(Adyghe = "adyg1241", Udi = "udii1243"))
expect_equal(gltc.lang(df), c(my_langs1 = "adyg1241", my_langs2 = "udii1243"))
Expand Down
3 changes: 2 additions & 1 deletion tests/testthat/test-grambank-feature.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
library(lingtypology)
context("Tests for grambank.feature function")

test_that("wals.feature", {
test_that("grambank.feature", {
skip_on_cran()
expect_error(grambank.feature(c("aa", "bb")), "There is no features 'aa', 'bb' in Grambank database.")
})

1 change: 1 addition & 0 deletions tests/testthat/test-iso-gltc.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ context("Tests for iso.gltc function")
df <- data.frame(my_langs = c("adyg1241", "udii1243"), stringsAsFactors = FALSE)

test_that("iso.gltc", {
skip_on_cran()
expect_equal(iso.gltc("adyg1241"), c(adyg1241 = "ady"))
expect_equal(iso.gltc(c("adyg1241", "udii1243")), c(adyg1241 = "ady", udii1243 = "udi"))
expect_equal(iso.gltc(df), c(my_langs1 = "ady", my_langs2 = "udi"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-iso-lang.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ context("Tests for iso.lang function")
df <- data.frame(my_langs = c("Adyghe", "Udi"), stringsAsFactors = FALSE)

test_that("iso.lang", {
skip_on_cran()
expect_equal(iso.lang("Adyghe"), c(Adyghe = "ady"))
expect_equal(iso.lang(c("Adyghe", "Udi")), c(Adyghe = "ady", Udi = "udi"))
expect_equal(iso.lang(df), c(my_langs1 = "ady", my_langs2 = "udi"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-lang-aff.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ library(lingtypology)
df <- data.frame(my_langs = c("Baltic"), stringsAsFactors = FALSE)

test_that("lang.aff", {
skip_on_cran()
expect_equal(lang.aff("Baltic"), c("Lithuanian", "Latvian"))
expect_equal(lang.aff(df), c(my_langs1 = "Lithuanian",
my_langs2 = "Latvian"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-lang-gltc.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ context("Tests for lang.gltc function")
df <- data.frame(my_langs = c("adyg1241", "russ1263"), stringsAsFactors = FALSE)

test_that("lang.gltc", {
skip_on_cran()
expect_equal(lang.gltc("adyg1241"), c(adyg1241 = "Adyghe"))
expect_equal(lang.gltc(df), c(my_langs1 = "Adyghe", my_langs2 = "Russian"))
expect_equal(lang.gltc(c("adyg1241", "russ1263")), c(adyg1241 = "Adyghe", russ1263 = "Russian"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-lang-iso.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ context("Tests for lang.iso function")
df <- data.frame(my_langs = c("ady", "rus"), stringsAsFactors = FALSE)

test_that("lang.iso", {
skip_on_cran()
expect_equal(lang.iso("ady"), c(ady = "Adyghe"))
expect_equal(lang.iso(df), c(my_langs1 = "Adyghe", my_langs2 = "Russian"))
expect_equal(lang.iso(c("ady", "rus")), c(ady = "Adyghe", rus = "Russian"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-lat-lang.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ context("Tests for lat.lang function")
df <- data.frame(my_langs = c("Adyghe", "Russian"), stringsAsFactors = FALSE)

test_that("lat.lang", {
skip_on_cran()
expect_equal(lat.lang("Adyghe"), c(Adyghe = 44))
expect_equal(lat.lang(df), c(my_langs1 = 44, my_langs2 = 59))
expect_equal(lat.lang(c("Adyghe", "Russian")), c(Adyghe = 44, Russian = 59))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-level.lang.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ context("Tests for level.lang function")
df <- data.frame(my_langs = c("Adyghe", "Russian Sign Language"), stringsAsFactors = FALSE)

test_that("lang.gltc", {
skip_on_cran()
expect_equal(level.lang("Adyghe"), c(Adyghe = "language"))
expect_equal(level.lang(df), c(my_langs1 = "language", my_langs2 = "dialect"))
expect_equal(level.lang(c("Adyghe", "Russian Sign Language")), c(Adyghe = "language", `Russian Sign Language` = "dialect"))
Expand Down
1 change: 1 addition & 0 deletions tests/testthat/test-long-lang.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ context("Tests for long.lang function")
df <- data.frame(my_langs = c("Adyghe", "Russian"), stringsAsFactors = FALSE)

test_that("long.lang", {
skip_on_cran()
expect_equal(long.lang("Adyghe"), c(Adyghe = 39.33))
expect_equal(long.lang(c("Adyghe", "Russian")), c(Adyghe = 39.33, Russian = 50))
expect_equal(long.lang(df), c(my_langs1 = 39.33, my_langs2 = 50))
Expand Down

0 comments on commit 553c244

Please sign in to comment.