Title: | R Interface to the 'LTP'-Cloud Service |
---|---|
Description: | R interface to the 'LTP'-Cloud service for Natural Language Processing in Chinese (http://www.ltp-cloud.com/). |
Authors: | Tong He [aut, cre], Oliver Keyes [ctb] |
Maintainer: | Tong He <[email protected]> |
License: | LGPL |
Version: | 0.1.4 |
Built: | 2025-02-21 03:59:35 UTC |
Source: | https://github.com/hetong007/rltp |
Indicate whether the encoding of input string is BIG5.
isBIG5(string, combine = FALSE)
isBIG5(string, combine = FALSE)
string |
A character vector. |
combine |
Whether to combine all the strings. |
A vector of logical values, the length of string
- or a single logical value if combine
is TRUE.
Jian Li <[email protected]>
Indicate whether the encoding of input string is GBK.
isGB18030(string, combine = FALSE)
isGB18030(string, combine = FALSE)
string |
A character vector. |
combine |
Whether to combine all the strings. |
A vector of logical values, the length of string
- or a single logical value if combine
is TRUE.
Jian Li <[email protected]>
Indicate whether the encoding of input string is GB18030.
isGB2312(string, combine = FALSE)
isGB2312(string, combine = FALSE)
string |
A character vector. |
combine |
Whether to combine all the strings. |
A vector of logical values, the length of string
- or a single logical value if combine
is TRUE.
Jian Li <[email protected]>
Indicate whether the encoding of input string is GBK.
isGBK(string, combine = FALSE)
isGBK(string, combine = FALSE)
string |
A character vector. |
combine |
Whether to combine all the strings. |
A vector of logical values, the length of string
- or a single logical value if combine
is TRUE.
Jian Li <[email protected]>
Indicate whether the encoding of input string is UTF-8.
isUTF8(string, combine = FALSE)
isUTF8(string, combine = FALSE)
string |
A character vector. |
combine |
Whether to combine all the strings. |
A vector of logical values, the length of string
- or a single logical value if combine
is TRUE.
Jian Li <[email protected]>
This function deals with communication with the server. XML result will be parsed if the mission is word-splitting. Else the raw XML texts will be returned for further analysis.
ltp(input = NULL, file = NULL, mission = "ws", api_key = getOption("ltp_api_key"), maxUpload = 1e+05)
ltp(input = NULL, file = NULL, mission = "ws", api_key = getOption("ltp_api_key"), maxUpload = 1e+05)
input |
The input text. |
file |
The input file. |
mission |
Expected result for the cloud server, may be unfinished. Optional choices are 'ws' for word-splitting, 'pos' for part-of-speech, 'ner' for named entity recognition, 'dp' for dependency parser, 'srl' for semantic role labeling, 'all' for all missions. |
api_key |
Your API_Key for the cloud server. Visit http://www.ltp-cloud.com/dashboard/ to get it. |
maxUpload |
Due to the limitation of the server, we cut the input in pieces. |
## Not run: # require(rLTP) # This api_key is publicly accessible. # So it is strongly recommended to register for your own key. # options(ltp_api_key='l2T9N724koSqEcDJvQHtRGVV2erajgPOgB0FAcLj') # ltp('Replace this field with a Chinese sentence.') ## End(Not run)
## Not run: # require(rLTP) # This api_key is publicly accessible. # So it is strongly recommended to register for your own key. # options(ltp_api_key='l2T9N724koSqEcDJvQHtRGVV2erajgPOgB0FAcLj') # ltp('Replace this field with a Chinese sentence.') ## End(Not run)
Convert encoding of Chinese string to UTF-8.
toUTF8(cnstring)
toUTF8(cnstring)
cnstring |
A Chinese string vector. |
Converted vectors.
Jian Li <[email protected]>