当前位置: 首页>>代码示例 >>用法及示例精选 >>正文


R stringr stringr-data 用于练习字符串操作的示例字符向量


fruitwords来自Gabor Csardi编写的rcorpora包;该数据由 Darius Kazemi 收集并在 https://github.com/dariusk/corpora 上提供。 sentences是"Harvard sentences"的集合,用于语音标准化测试。

用法

sentences

fruit

words

格式

字符向量。

例子

length(sentences)
#> [1] 720
sentences[1:5]
#> [1] "The birch canoe slid on the smooth planks." 
#> [2] "Glue the sheet to the dark blue background."
#> [3] "It's easy to tell the depth of a well."     
#> [4] "These days a chicken leg is a rare dish."   
#> [5] "Rice is often served in round bowls."       

length(fruit)
#> [1] 80
fruit[1:5]
#> [1] "apple"       "apricot"     "avocado"     "banana"      "bell pepper"

length(words)
#> [1] 980
words[1:5]
#> [1] "a"        "able"     "about"    "absolute" "accept"  
源代码:R/data.R

相关用法


注:本文由纯净天空筛选整理自Hadley Wickham等大神的英文原创作品 Sample character vectors for practicing string manipulations。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。