【发布时间】:2018-10-12 14:58:41
【问题描述】:
我想使用 HiveQL 创建一个 n-gram 列表。我的想法是使用带有前瞻和拆分功能的正则表达式 - 但是这不起作用:
select split('This is my sentence', '(\\S+) +(?=(\\S+))');
输入是表单的一列
|sentence |
|-------------------------|
|This is my sentence |
|This is another sentence |
输出应该是:
["This is","is my","my sentence"]
["This is","is another","another sentence"]
Hive 中有一个 n-gram udf,但该函数直接计算 n-gram 的频率 - 我想要一个所有 n-gram 的列表。
提前非常感谢!
【问题讨论】:
标签: sql hadoop hive hiveql n-gram