Displaying 6 results from an estimated 6 matches for "ntokens".
Did you mean:
tokens
2004 Dec 01
1
split() and paste() a vector to get a multi line string
...i line string from a vector of string tokens
in an easy manner (e.g. for the use as xlab of a plot)?
I have e.g.:
> tokens <- letters[1:5]
[1] "a" "b" "c" "d" "e"
I search:
[1] "a, b, c\nd, e"
I tried:
> nlines <- 2
> ntokens.line <- ceiling(length(tokens) / nlines)
> token.list <- split(tokens, rep( 1:ntokens.line, each=ntokens.line, len=length(tokens)))
$"1"
[1] "a" "b" "c"
$"2"
[1] "d" "e"
I could work with a data.frame, e.g.:
> paste(...
2024 Jan 29
1
strcapture performance when perl = TRUE
...Toby Hocking
in the nc package - nc::capture_first_vec).
strcapture2 <- function(pattern, x, proto, perl = FALSE, useBytes = FALSE) {
if (isTRUE(perl)) {
m <- regexpr(pattern = pattern, text = x, perl = TRUE, useBytes = useBytes)
nomatch <- is.na(m) | m == -1L
ntokens <- length(proto)
if (any(!nomatch)) {
length <- attr(m, "match.length")
start <- attr(m, "capture.start")
length <- attr(m, "capture.length")
end <- start + length - 1L
end[nomatch, ] &l...
2016 Oct 04
1
error handling in strcapture
...ch.
> strcapture("(.)(.)", c("ab", "cde", "fgh", "ij", "lm"),
proto=list(A="",B="",C=""))
A B C
1 a b cd
2 d fg f
3 ij i j
4 l m ab
Warning message:
In matrix(as.character(unlist(str)), ncol = ntokens, byrow = TRUE) :
data length [15] is not a sub-multiple or multiple of the number of rows
[4]
> strcapture("(.)(.)(.)", c("abc", "def", "ghi", "jkl", "mno"),
proto=list(A="",B=""))
A B
1 a b
2 def d
3...
2013 Sep 30
1
[LLVMdev] RFC: llvm-shlib-test (Was: [llvm] r191029 - llvm-c: Make LLVMGetFirstTarget a proper prototype)
Attached is what I got thus far.
What I'm struggling with is proper integration in build system. What
is in there is just wild guesses from my side, both on autoconf and
cmake variants. It would be great if someone with proper knowledge of
the buildsystems could have a look. Also I'm not sure how to properly
handle compilation on msvc - clearly "-std=c11 -Wstrict-prototypes" is
2016 Oct 04
2
error handling in strcapture
I noticed a problem in the strcapture from R-devel (2016-09-27 r71386),
when the text contains a missing value and perl=TRUE.
{
# NA in text input should map to row of NA's in output, without
warning
r9p <- strcapture(perl = TRUE, "(.).* ([[:digit:]]+)", c("One 1", NA,
"Fifty 50"), data.frame(Initial=factor(), Number=numeric()))
e9p <-
2005 May 16
2
spamassassin
...messages, it works...
]# sa-learn --dump magic
0.000 0 3 0 non-token data: bayes db version
0.000 0 3997 0 non-token data: nspam
0.000 0 0 0 non-token data: nham
0.000 0 202022 0 non-token data: ntokens
0.000 0 1086136394 0 non-token data: oldest atime
0.000 0 1116269429 0 non-token data: newest atime
0.000 0 1116269429 0 non-token data: last journal
sync atime
0.000 0 1116269429 0 non-token data: last expiry
atime
0.000...