diff --git a/docs/src/manpage.md b/docs/src/manpage.md index acbf21a25..354307825 100644 --- a/docs/src/manpage.md +++ b/docs/src/manpage.md @@ -2502,32 +2502,32 @@ FUNCTIONS FOR FILTER/PUT Map example: sort({"c":2,"a":3,"b":1}, func(ak,av,bk,bv) {return bv <=> av}) returns {"a":3,"c":2,"b":1}. splita - (class=conversion #args=2) Splits string into array with type inference. + (class=conversion #args=2) Splits string into array with type inference. First argument is string to split; second is the separator to split on. Example: splita("3,4,5", ",") = [3,4,5] splitax - (class=conversion #args=2) Splits string into array without type inference. + (class=conversion #args=2) Splits string into array without type inference. First argument is string to split; second is the separator to split on. Example: splita("3,4,5", ",") = ["3","4","5"] splitkv - (class=conversion #args=3) Splits string by separators into map with type inference. + (class=conversion #args=3) Splits string by separators into map with type inference. First argument is string to split; second argument is pair separator; third argument is field separator. Example: splitkv("a=3,b=4,c=5", "=", ",") = {"a":3,"b":4,"c":5} splitkvx - (class=conversion #args=3) Splits string by separators into map without type inference (keys and values are strings). + (class=conversion #args=3) Splits string by separators into map without type inference (keys and values are strings). First argument is string to split; second argument is pair separator; third argument is field separator. Example: splitkvx("a=3,b=4,c=5", "=", ",") = {"a":"3","b":"4","c":"5"} splitnv - (class=conversion #args=2) Splits string by separator into integer-indexed map with type inference. + (class=conversion #args=2) Splits string by separator into integer-indexed map with type inference. First argument is string to split; second argument is separator to split on. Example: splitnv("a,b,c", ",") = {"1":"a","2":"b","3":"c"} splitnvx - (class=conversion #args=2) Splits string by separator into integer-indexed map without type inference (values are strings). + (class=conversion #args=2) Splits string by separator into integer-indexed map without type inference (values are strings). First argument is string to split; second argument is separator to split on. Example: splitnvx("3,4,5", ",") = {"1":"3","2":"4","3":"5"} diff --git a/docs/src/manpage.txt b/docs/src/manpage.txt index 101bfca26..603bcd290 100644 --- a/docs/src/manpage.txt +++ b/docs/src/manpage.txt @@ -2481,32 +2481,32 @@ FUNCTIONS FOR FILTER/PUT Map example: sort({"c":2,"a":3,"b":1}, func(ak,av,bk,bv) {return bv <=> av}) returns {"a":3,"c":2,"b":1}. splita - (class=conversion #args=2) Splits string into array with type inference. + (class=conversion #args=2) Splits string into array with type inference. First argument is string to split; second is the separator to split on. Example: splita("3,4,5", ",") = [3,4,5] splitax - (class=conversion #args=2) Splits string into array without type inference. + (class=conversion #args=2) Splits string into array without type inference. First argument is string to split; second is the separator to split on. Example: splita("3,4,5", ",") = ["3","4","5"] splitkv - (class=conversion #args=3) Splits string by separators into map with type inference. + (class=conversion #args=3) Splits string by separators into map with type inference. First argument is string to split; second argument is pair separator; third argument is field separator. Example: splitkv("a=3,b=4,c=5", "=", ",") = {"a":3,"b":4,"c":5} splitkvx - (class=conversion #args=3) Splits string by separators into map without type inference (keys and values are strings). + (class=conversion #args=3) Splits string by separators into map without type inference (keys and values are strings). First argument is string to split; second argument is pair separator; third argument is field separator. Example: splitkvx("a=3,b=4,c=5", "=", ",") = {"a":"3","b":"4","c":"5"} splitnv - (class=conversion #args=2) Splits string by separator into integer-indexed map with type inference. + (class=conversion #args=2) Splits string by separator into integer-indexed map with type inference. First argument is string to split; second argument is separator to split on. Example: splitnv("a,b,c", ",") = {"1":"a","2":"b","3":"c"} splitnvx - (class=conversion #args=2) Splits string by separator into integer-indexed map without type inference (values are strings). + (class=conversion #args=2) Splits string by separator into integer-indexed map without type inference (values are strings). First argument is string to split; second argument is separator to split on. Example: splitnvx("3,4,5", ",") = {"1":"3","2":"4","3":"5"} diff --git a/docs/src/online-help.md b/docs/src/online-help.md index 0b6d9a674..bfbecec99 100644 --- a/docs/src/online-help.md +++ b/docs/src/online-help.md @@ -242,7 +242,7 @@ append (class=collections #args=2) Appends second argument to end of first argu mlr help function splita
-splita  (class=conversion #args=2) Splits string into array with type inference.
+splita  (class=conversion #args=2) Splits string into array with type inference. First argument is string to split; second is the separator to split on.
 Example:
 splita("3,4,5", ",") = [3,4,5]
 
diff --git a/docs/src/reference-dsl-builtin-functions.md b/docs/src/reference-dsl-builtin-functions.md index f742523e0..c6038e044 100644 --- a/docs/src/reference-dsl-builtin-functions.md +++ b/docs/src/reference-dsl-builtin-functions.md @@ -535,7 +535,7 @@ joinv({"a":3,"b":4,"c":5}, ",") = "3,4,5" ### splita
-splita  (class=conversion #args=2) Splits string into array with type inference.
+splita  (class=conversion #args=2) Splits string into array with type inference. First argument is string to split; second is the separator to split on.
 Example:
 splita("3,4,5", ",") = [3,4,5]
 
@@ -543,7 +543,7 @@ splita("3,4,5", ",") = [3,4,5] ### splitax
-splitax  (class=conversion #args=2) Splits string into array without type inference.
+splitax  (class=conversion #args=2) Splits string into array without type inference. First argument is string to split; second is the separator to split on.
 Example:
 splita("3,4,5", ",") = ["3","4","5"]
 
@@ -551,7 +551,7 @@ splita("3,4,5", ",") = ["3","4","5"] ### splitkv
-splitkv  (class=conversion #args=3) Splits string by separators into map with type inference.
+splitkv  (class=conversion #args=3) Splits string by separators into map with type inference. First argument is string to split; second argument is pair separator; third argument is field separator.
 Example:
 splitkv("a=3,b=4,c=5", "=", ",") = {"a":3,"b":4,"c":5}
 
@@ -559,7 +559,7 @@ splitkv("a=3,b=4,c=5", "=", ",") = {"a":3,"b":4,"c":5} ### splitkvx
-splitkvx  (class=conversion #args=3) Splits string by separators into map without type inference (keys and values are strings).
+splitkvx  (class=conversion #args=3) Splits string by separators into map without type inference (keys and values are strings). First argument is string to split; second argument is pair separator; third argument is field separator.
 Example:
 splitkvx("a=3,b=4,c=5", "=", ",") = {"a":"3","b":"4","c":"5"}
 
@@ -567,7 +567,7 @@ splitkvx("a=3,b=4,c=5", "=", ",") = {"a":"3","b":"4","c":"5"} ### splitnv
-splitnv  (class=conversion #args=2) Splits string by separator into integer-indexed map with type inference.
+splitnv  (class=conversion #args=2) Splits string by separator into integer-indexed map with type inference. First argument is string to split; second argument is separator to split on.
 Example:
 splitnv("a,b,c", ",") = {"1":"a","2":"b","3":"c"}
 
@@ -575,7 +575,7 @@ splitnv("a,b,c", ",") = {"1":"a","2":"b","3":"c"} ### splitnvx
-splitnvx  (class=conversion #args=2) Splits string by separator into integer-indexed map without type inference (values are strings).
+splitnvx  (class=conversion #args=2) Splits string by separator into integer-indexed map without type inference (values are strings). First argument is string to split; second argument is separator to split on.
 Example:
 splitnvx("3,4,5", ",") = {"1":"3","2":"4","3":"5"}
 
diff --git a/internal/pkg/dsl/cst/builtin_function_manager.go b/internal/pkg/dsl/cst/builtin_function_manager.go index 2bf4f087a..33c92303a 100644 --- a/internal/pkg/dsl/cst/builtin_function_manager.go +++ b/internal/pkg/dsl/cst/builtin_function_manager.go @@ -1492,7 +1492,8 @@ second is pair-separator string; third is field-separator string. Mnemonic: the { name: "splita", class: FUNC_CLASS_CONVERSION, - help: `Splits string into array with type inference.`, + help: `Splits string into array with type inference. First argument is string to split; +second is the separator to split on.`, examples: []string{ `splita("3,4,5", ",") = [3,4,5]`, }, @@ -1502,7 +1503,8 @@ second is pair-separator string; third is field-separator string. Mnemonic: the { name: "splitax", class: FUNC_CLASS_CONVERSION, - help: `Splits string into array without type inference.`, + help: `Splits string into array without type inference. First argument is string to split; +second is the separator to split on.`, examples: []string{ `splita("3,4,5", ",") = ["3","4","5"]`, }, @@ -1512,7 +1514,8 @@ second is pair-separator string; third is field-separator string. Mnemonic: the { name: "splitkv", class: FUNC_CLASS_CONVERSION, - help: `Splits string by separators into map with type inference.`, + help: `Splits string by separators into map with type inference. First argument is string to split; +second argument is pair separator; third argument is field separator.`, examples: []string{ `splitkv("a=3,b=4,c=5", "=", ",") = {"a":3,"b":4,"c":5}`, }, @@ -1522,7 +1525,9 @@ second is pair-separator string; third is field-separator string. Mnemonic: the { name: "splitkvx", class: FUNC_CLASS_CONVERSION, - help: `Splits string by separators into map without type inference (keys and values are strings).`, + help: `Splits string by separators into map without type inference +(keys and values are strings). First argument is string to split; second +argument is pair separator; third argument is field separator.`, examples: []string{ `splitkvx("a=3,b=4,c=5", "=", ",") = {"a":"3","b":"4","c":"5"}`, }, @@ -1532,7 +1537,8 @@ second is pair-separator string; third is field-separator string. Mnemonic: the { name: "splitnv", class: FUNC_CLASS_CONVERSION, - help: `Splits string by separator into integer-indexed map with type inference.`, + help: `Splits string by separator into integer-indexed map with type inference. First argument is +string to split; second argument is separator to split on.`, examples: []string{ `splitnv("a,b,c", ",") = {"1":"a","2":"b","3":"c"}`, }, @@ -1542,7 +1548,9 @@ second is pair-separator string; third is field-separator string. Mnemonic: the { name: "splitnvx", class: FUNC_CLASS_CONVERSION, - help: `Splits string by separator into integer-indexed map without type inference (values are strings).`, + help: `Splits string by separator into integer-indexed map without +type inference (values are strings). First argument is string to split; second +argument is separator to split on.`, examples: []string{ `splitnvx("3,4,5", ",") = {"1":"3","2":"4","3":"5"}`, }, diff --git a/man/manpage.txt b/man/manpage.txt index 101bfca26..603bcd290 100644 --- a/man/manpage.txt +++ b/man/manpage.txt @@ -2481,32 +2481,32 @@ FUNCTIONS FOR FILTER/PUT Map example: sort({"c":2,"a":3,"b":1}, func(ak,av,bk,bv) {return bv <=> av}) returns {"a":3,"c":2,"b":1}. splita - (class=conversion #args=2) Splits string into array with type inference. + (class=conversion #args=2) Splits string into array with type inference. First argument is string to split; second is the separator to split on. Example: splita("3,4,5", ",") = [3,4,5] splitax - (class=conversion #args=2) Splits string into array without type inference. + (class=conversion #args=2) Splits string into array without type inference. First argument is string to split; second is the separator to split on. Example: splita("3,4,5", ",") = ["3","4","5"] splitkv - (class=conversion #args=3) Splits string by separators into map with type inference. + (class=conversion #args=3) Splits string by separators into map with type inference. First argument is string to split; second argument is pair separator; third argument is field separator. Example: splitkv("a=3,b=4,c=5", "=", ",") = {"a":3,"b":4,"c":5} splitkvx - (class=conversion #args=3) Splits string by separators into map without type inference (keys and values are strings). + (class=conversion #args=3) Splits string by separators into map without type inference (keys and values are strings). First argument is string to split; second argument is pair separator; third argument is field separator. Example: splitkvx("a=3,b=4,c=5", "=", ",") = {"a":"3","b":"4","c":"5"} splitnv - (class=conversion #args=2) Splits string by separator into integer-indexed map with type inference. + (class=conversion #args=2) Splits string by separator into integer-indexed map with type inference. First argument is string to split; second argument is separator to split on. Example: splitnv("a,b,c", ",") = {"1":"a","2":"b","3":"c"} splitnvx - (class=conversion #args=2) Splits string by separator into integer-indexed map without type inference (values are strings). + (class=conversion #args=2) Splits string by separator into integer-indexed map without type inference (values are strings). First argument is string to split; second argument is separator to split on. Example: splitnvx("3,4,5", ",") = {"1":"3","2":"4","3":"5"} diff --git a/man/mlr.1 b/man/mlr.1 index e2a12b478..1dc18c120 100644 --- a/man/mlr.1 +++ b/man/mlr.1 @@ -3828,7 +3828,7 @@ Map example: sort({"c":2,"a":3,"b":1}, func(ak,av,bk,bv) {return bv <=> av}) ret .RS 0 .\} .nf - (class=conversion #args=2) Splits string into array with type inference. + (class=conversion #args=2) Splits string into array with type inference. First argument is string to split; second is the separator to split on. Example: splita("3,4,5", ",") = [3,4,5] .fi @@ -3839,7 +3839,7 @@ splita("3,4,5", ",") = [3,4,5] .RS 0 .\} .nf - (class=conversion #args=2) Splits string into array without type inference. + (class=conversion #args=2) Splits string into array without type inference. First argument is string to split; second is the separator to split on. Example: splita("3,4,5", ",") = ["3","4","5"] .fi @@ -3850,7 +3850,7 @@ splita("3,4,5", ",") = ["3","4","5"] .RS 0 .\} .nf - (class=conversion #args=3) Splits string by separators into map with type inference. + (class=conversion #args=3) Splits string by separators into map with type inference. First argument is string to split; second argument is pair separator; third argument is field separator. Example: splitkv("a=3,b=4,c=5", "=", ",") = {"a":3,"b":4,"c":5} .fi @@ -3861,7 +3861,7 @@ splitkv("a=3,b=4,c=5", "=", ",") = {"a":3,"b":4,"c":5} .RS 0 .\} .nf - (class=conversion #args=3) Splits string by separators into map without type inference (keys and values are strings). + (class=conversion #args=3) Splits string by separators into map without type inference (keys and values are strings). First argument is string to split; second argument is pair separator; third argument is field separator. Example: splitkvx("a=3,b=4,c=5", "=", ",") = {"a":"3","b":"4","c":"5"} .fi @@ -3872,7 +3872,7 @@ splitkvx("a=3,b=4,c=5", "=", ",") = {"a":"3","b":"4","c":"5"} .RS 0 .\} .nf - (class=conversion #args=2) Splits string by separator into integer-indexed map with type inference. + (class=conversion #args=2) Splits string by separator into integer-indexed map with type inference. First argument is string to split; second argument is separator to split on. Example: splitnv("a,b,c", ",") = {"1":"a","2":"b","3":"c"} .fi @@ -3883,7 +3883,7 @@ splitnv("a,b,c", ",") = {"1":"a","2":"b","3":"c"} .RS 0 .\} .nf - (class=conversion #args=2) Splits string by separator into integer-indexed map without type inference (values are strings). + (class=conversion #args=2) Splits string by separator into integer-indexed map without type inference (values are strings). First argument is string to split; second argument is separator to split on. Example: splitnvx("3,4,5", ",") = {"1":"3","2":"4","3":"5"} .fi