casefuns(Unicode)
casefuns()所属R语言包:Unicode
Unicode Case Conversions
Unicode的大小写转换
译者:生物统计家园网 机器人LoveR
描述----------Description----------
Default Unicode algorithms for case conversion.
默认情况下,转换为Unicode的算法。
用法----------Usage----------
u_to_lower_case(x)
u_to_upper_case(x)
u_to_title_case(x)
u_case_fold(x)
参数----------Arguments----------
参数:x
R objects (see Details).
R对象(见详情)。
Details
详细信息----------Details----------
These functions are generic functions, with methods for the Unicode character classes (u_char, u_char_range, and u_char_seq) which suitably apply the case mappings to the Unicode characters given by x, and a default method which treats x as a vector of “Unicode strings”, and returns a vector of UTF-8 encoded character strings with the results of the case conversion of the elements of x.
这些功能的通用功能,方法适当的情况下映射到Unicode字符由u_char的Unicode字符类(u_char_range,u_char_seq和x) ,和默认的方法,它把x作为向量的“Unicode字符串”UTF-8编码的字符串,并返回一个向量的x的元素的情况下,转换的结果。
Currently, only the unconditional case maps are available for conversion to lower, upper or title case: other variants may be added eventually.
目前,只有无条件的情况下,图可转换为下方,上方或标题的情况下:其他的变种,最终可能会增加。
Currently, conversion to title case is only available for u_char objects. Other methods will be added eventually (once the Unicode text segmentation algorithm is implemented for detecting word boundaries).
目前,转换为标题是只适用于u_char对象。其他方法,最终将被添加(一次检测单词边界)的Unicode文本分割算法的实现。
Currently, u_case_fold only performs full case folding using the Unicode case mappings with status “C” and “F”: other variants will be added eventually.
目前,u_case_fold只有进行充分的情况下,倍数状态为“C”和“F”使用的是Unicode大小写映射:其他变体将添加最后。
值----------Value----------
For the methods for the Unicode character classes, a u_char_seq vector of Unicode character sequences with the conversions of the characters in x.
对于Unicode字符类,u_char_seq的Unicode字符序列中的字符x的转化向量的方法。
For the default method, a UTF-8 encoded character string with the results of the case conversions of the elements of x.
默认的方法,一个UTF-8编码的字符串的元素x的情况下转换的结果。
实例----------Examples----------
## Latin upper case letters A to Z:[#拉丁大写字母A到Z:]
x <- as.u_char(as.u_char_range("0041..005A"))
## In case we did not know the code points, we could use e.g.[#情况下,我们不知道的代码点,我们可以使用如]
x <- as.u_char(utf8ToInt(paste(LETTERS, collapse = "")))
sapply(x, intToUtf8)
## Unicode character method:[#Unicode字符的方法:]
sapply(u_to_lower_case(x), intToUtf8)
## Default method:[#默认的方法:]
u_to_lower_case(LETTERS)
u_case_fold("Hi Dave.")
## More interesting stuff: sharp s.[#更多有趣的东西的sharp s。]
u_to_upper_case("hei脽")
## Note that the default full upper case mapping of U+00DF (LATIN SMALL[#请注意,默认情况下全大写映射U +00 DF(拉丁小]
## LETTER SHARP S) is *not* to U+1E9E (LATIN CAPITAL LETTER SHARP S).[#函件SHARP S)是*不* U +1 E9E(LATIN CAPITAL LETTER SHARP S)。]
u_case_fold("hei脽")
转载请注明:出自 生物统计家园网(http://www.biostatistic.net)。
注:
注1:为了方便大家学习,本文档为生物统计家园网机器人LoveR翻译而成,仅供个人R语言学习参考使用,生物统计家园保留版权。
注2:由于是机器人自动翻译,难免有不准确之处,使用时仔细对照中、英文内容进行反复理解,可以帮助R语言的学习。
注3:如遇到不准确之处,请在本贴的后面进行回帖,我们会逐渐进行修订。
|