r - 根据我扫描的列表单词拆分句子
问题描述
我有一个单词列表,如下所示:
a <-c ("swipe","swiped", "electric", "blower", "shock", "wipe", "capacitor", "resistor")
我有一个需要拆分的句子:
b <- c("swipedshockelectricwipeblower")
我需要以下输出:
c <- ("swiped", "shock", "electric", "wipe", "blower")
而且我不需要像下面这样的输出(因为我的单词列表中都有刷卡和刷卡)
c_wrong <- ("swipe", "d", "shock", "electric", "wipe", "blower")
解决方案
推荐阅读
- python - 我如何将用户发送到新的“块”而不是继续相同的路径?
- python - 如何修复错误 Python Selenium Chromdriver 中不可交互的元素
- hadoop - 如何使用“WARN HadoopFileSystemOwner: found no group information for myname (auth:SIMPLE)”停止 hadoop 垃圾邮件日志
- python - 如何用另一个数据框行重命名列名?
- ruby - 使用默认值的rails嵌套哈希
- java - Java 8 - 可选
在 CustomizedObject 中获取列表的第一个元素 - java - Java - 如何从运行 Java 程序的主命令行获取输入?
- java - 找不到合适的驱动程序雪花 JDBC
- ios - 如何在 Xamarin.Forms ios 中更改工具栏图标颜色
- javascript - 更改模态窗口