aboutsummaryrefslogtreecommitdiff
path: root/KOR.addrlink/tests
diff options
context:
space:
mode:
Diffstat (limited to 'KOR.addrlink/tests')
-rw-r--r--KOR.addrlink/tests/Examples/KOR.addrlink-Ex.Rout.save81
-rw-r--r--KOR.addrlink/tests/test_l1score.R1
-rw-r--r--KOR.addrlink/tests/test_l1score.Rout.save23
-rw-r--r--KOR.addrlink/tests/test_sanitize_street.R1
-rw-r--r--KOR.addrlink/tests/test_sanitize_street.Rout.save23
-rw-r--r--KOR.addrlink/tests/test_split_address.R2
-rw-r--r--KOR.addrlink/tests/test_split_address.Rout.save29
-rw-r--r--KOR.addrlink/tests/test_split_number.R1
-rw-r--r--KOR.addrlink/tests/test_split_number.Rout.save29
9 files changed, 190 insertions, 0 deletions
diff --git a/KOR.addrlink/tests/Examples/KOR.addrlink-Ex.Rout.save b/KOR.addrlink/tests/Examples/KOR.addrlink-Ex.Rout.save
new file mode 100644
index 0000000..b6c22d2
--- /dev/null
+++ b/KOR.addrlink/tests/Examples/KOR.addrlink-Ex.Rout.save
@@ -0,0 +1,81 @@
+
+R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
+Copyright (C) 2024 The R Foundation for Statistical Computing
+Platform: x86_64-pc-linux-gnu (64-bit)
+
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+
+ Natural language support but running in an English locale
+
+R is a collaborative project with many contributors.
+Type 'contributors()' for more information and
+'citation()' on how to cite R or R packages in publications.
+
+Type 'demo()' for some demos, 'help()' for on-line help, or
+'help.start()' for an HTML browser interface to help.
+Type 'q()' to quit R.
+
+> pkgname <- "KOR.addrlink"
+> source(file.path(R.home("share"), "R", "examples-header.R"))
+> options(warn = 1)
+> library('KOR.addrlink')
+>
+> base::assign(".oldSearch", base::search(), pos = 'CheckExEnv')
+> base::assign(".old_wd", base::getwd(), pos = 'CheckExEnv')
+> cleanEx()
+> nameEx("split_address")
+> ### * split_address
+>
+> flush(stderr()); flush(stdout())
+>
+> ### Name: split_address
+> ### Title: Split Adresses Into Street, House Number And Additional Letter
+> ### Aliases: split_address
+>
+> ### ** Examples
+>
+> split_address(c("Teststr. 8-9 a", "Erster Weg 1-2", "Ahornallee 100a-102c"))
+ Strasse Hausnummer Hausnummernzusatz
+1 Teststr. 8 A
+2 Erster Weg 1 <NA>
+3 Ahornallee 102 C
+>
+>
+>
+> cleanEx()
+> nameEx("split_number")
+> ### * split_number
+>
+> flush(stderr()); flush(stdout())
+>
+> ### Name: split_number
+> ### Title: Split house number into house number and additional letter
+> ### Aliases: split_number
+>
+> ### ** Examples
+>
+> split_number(c("8-9 a", "1-2", "100a-102c"))
+ Hausnummer Hausnummernzusatz
+1 8 <NA>
+2 1 <NA>
+3 100 a
+>
+>
+>
+> ### * <FOOTER>
+> ###
+> cleanEx()
+> options(digits = 7L)
+> base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
+Time elapsed: 0.155 0.019 0.224 0.009 0.006
+> grDevices::dev.off()
+null device
+ 1
+> ###
+> ### Local variables: ***
+> ### mode: outline-minor ***
+> ### outline-regexp: "\\(> \\)?### [*]+" ***
+> ### End: ***
+> quit('no')
diff --git a/KOR.addrlink/tests/test_l1score.R b/KOR.addrlink/tests/test_l1score.R
new file mode 100644
index 0000000..6708f80
--- /dev/null
+++ b/KOR.addrlink/tests/test_l1score.R
@@ -0,0 +1 @@
+KOR.addrlink:::l1score(c(-4, -1.3, 0, NA, 5.1, 10))
diff --git a/KOR.addrlink/tests/test_l1score.Rout.save b/KOR.addrlink/tests/test_l1score.Rout.save
new file mode 100644
index 0000000..6e952b2
--- /dev/null
+++ b/KOR.addrlink/tests/test_l1score.Rout.save
@@ -0,0 +1,23 @@
+
+R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
+Copyright (C) 2024 The R Foundation for Statistical Computing
+Platform: x86_64-pc-linux-gnu (64-bit)
+
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+
+R is a collaborative project with many contributors.
+Type 'contributors()' for more information and
+'citation()' on how to cite R or R packages in publications.
+
+Type 'demo()' for some demos, 'help()' for on-line help, or
+'help.start()' for an HTML browser interface to help.
+Type 'q()' to quit R.
+
+> KOR.addrlink:::l1score(c(-4, -1.3, 0, NA, 5.1, 10))
+[1] 0.60 0.87 1.00 NA 0.49 0.00
+>
+> proc.time()
+ user system elapsed
+ 0.242 0.062 0.266
diff --git a/KOR.addrlink/tests/test_sanitize_street.R b/KOR.addrlink/tests/test_sanitize_street.R
new file mode 100644
index 0000000..3543a6b
--- /dev/null
+++ b/KOR.addrlink/tests/test_sanitize_street.R
@@ -0,0 +1 @@
+KOR.addrlink:::sanitize_street(c("Binde-Strich-Strasse", "Teststr.", "A.-B.-C.-Str."))
diff --git a/KOR.addrlink/tests/test_sanitize_street.Rout.save b/KOR.addrlink/tests/test_sanitize_street.Rout.save
new file mode 100644
index 0000000..3bb9e3f
--- /dev/null
+++ b/KOR.addrlink/tests/test_sanitize_street.Rout.save
@@ -0,0 +1,23 @@
+
+R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
+Copyright (C) 2024 The R Foundation for Statistical Computing
+Platform: x86_64-pc-linux-gnu (64-bit)
+
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+
+R is a collaborative project with many contributors.
+Type 'contributors()' for more information and
+'citation()' on how to cite R or R packages in publications.
+
+Type 'demo()' for some demos, 'help()' for on-line help, or
+'help.start()' for an HTML browser interface to help.
+Type 'q()' to quit R.
+
+> KOR.addrlink:::sanitize_street(c("Binde-Strich-Strasse", "Teststr.", "A.-B.-C.-Str."))
+[1] "bindestrichstrasse" "teststrasse" "abcstrasse"
+>
+> proc.time()
+ user system elapsed
+ 0.259 0.059 0.289
diff --git a/KOR.addrlink/tests/test_split_address.R b/KOR.addrlink/tests/test_split_address.R
new file mode 100644
index 0000000..7b7db48
--- /dev/null
+++ b/KOR.addrlink/tests/test_split_address.R
@@ -0,0 +1,2 @@
+KOR.addrlink::split_address(c("Teststr. 8-9 a", "Erster Weg 1-2", "Ahornallee 100a-102c",
+"Stra\u00dfe des 1. Mai 10/12", "Emmerich-K\u00e1lm\u00e1n-Stra\u00dfe 15"))
diff --git a/KOR.addrlink/tests/test_split_address.Rout.save b/KOR.addrlink/tests/test_split_address.Rout.save
new file mode 100644
index 0000000..65ab67b
--- /dev/null
+++ b/KOR.addrlink/tests/test_split_address.Rout.save
@@ -0,0 +1,29 @@
+
+R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
+Copyright (C) 2024 The R Foundation for Statistical Computing
+Platform: x86_64-pc-linux-gnu (64-bit)
+
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+
+R is a collaborative project with many contributors.
+Type 'contributors()' for more information and
+'citation()' on how to cite R or R packages in publications.
+
+Type 'demo()' for some demos, 'help()' for on-line help, or
+'help.start()' for an HTML browser interface to help.
+Type 'q()' to quit R.
+
+> KOR.addrlink::split_address(c("Teststr. 8-9 a", "Erster Weg 1-2", "Ahornallee 100a-102c",
++ "Stra\u00dfe des 1. Mai 10/12", "Emmerich-K\u00e1lm\u00e1n-Stra\u00dfe 15"))
+ Strasse Hausnummer Hausnummernzusatz
+1 Teststr. 8 A
+2 Erster Weg 1 <NA>
+3 Ahornallee 102 C
+4 Straße des 1. Mai 10 <NA>
+5 Emmerich-Kálmán-Straße 15 <NA>
+>
+> proc.time()
+ user system elapsed
+ 0.277 0.053 0.299
diff --git a/KOR.addrlink/tests/test_split_number.R b/KOR.addrlink/tests/test_split_number.R
new file mode 100644
index 0000000..81d01eb
--- /dev/null
+++ b/KOR.addrlink/tests/test_split_number.R
@@ -0,0 +1 @@
+KOR.addrlink::split_number(c("8-9 a", "1-2", "100a-102c", "2/3", "25/27a", "3 5"))
diff --git a/KOR.addrlink/tests/test_split_number.Rout.save b/KOR.addrlink/tests/test_split_number.Rout.save
new file mode 100644
index 0000000..766e419
--- /dev/null
+++ b/KOR.addrlink/tests/test_split_number.Rout.save
@@ -0,0 +1,29 @@
+
+R version 4.3.3 (2024-02-29) -- "Angel Food Cake"
+Copyright (C) 2024 The R Foundation for Statistical Computing
+Platform: x86_64-pc-linux-gnu (64-bit)
+
+R is free software and comes with ABSOLUTELY NO WARRANTY.
+You are welcome to redistribute it under certain conditions.
+Type 'license()' or 'licence()' for distribution details.
+
+R is a collaborative project with many contributors.
+Type 'contributors()' for more information and
+'citation()' on how to cite R or R packages in publications.
+
+Type 'demo()' for some demos, 'help()' for on-line help, or
+'help.start()' for an HTML browser interface to help.
+Type 'q()' to quit R.
+
+> KOR.addrlink::split_number(c("8-9 a", "1-2", "100a-102c", "2/3", "25/27a", "3 5"))
+ Hausnummer Hausnummernzusatz
+1 8 <NA>
+2 1 <NA>
+3 100 a
+4 2 <NA>
+5 25 <NA>
+6 3 <NA>
+>
+> proc.time()
+ user system elapsed
+ 0.246 0.054 0.274