| new_user_word | R Documentation |
Add one or more custom words to a jieba worker.
new_user_word(worker, words, ..., tags = "n", freq = NULL)
add_word(worker, words, ..., tags = "n", freq = NULL)
worker |
A |
words |
A non-empty string or a non-empty character vector of new words. |
... |
Must be empty. This enforces that optional arguments such as
|
tags |
A single tag or a character vector of tags. Defaults to |
freq |
Optional positive integer frequency or integer vector of
frequencies. Defaults to |
NULL, invisibly. Called for its side effect of adding the supplied
words to worker, thereby modifying the state used by subsequent
operations with the same worker.
cutter <- worker()
segment("\u91cf\u5b50\u673a\u5668\u72d7", cutter)
new_user_word(cutter, "\u91cf\u5b50\u673a\u5668\u72d7", tags = "n", freq = 1000L)
segment("\u91cf\u5b50\u673a\u5668\u72d7", cutter)
cutter2 <- worker()
add_word(
cutter2,
c("\u8d85\u5bfc\u91cf\u5b50\u6bd4\u7279", "\u91cf\u5b50\u673a\u5668\u72d7"),
tags = c(NA, "n"),
freq = c(NA, 1000L)
)
segment("\u8d85\u5bfc\u91cf\u5b50\u6bd4\u7279", cutter2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.