无法从星火流应用Twitter的API获取精确短语 [英] Not able to fetch exact phrase from the Twitter API in Spark Streaming application

查看:184
本文介绍了无法从星火流应用Twitter的API获取精确短语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的操作员,周末愉快。我想从Twitter的API精确短语。如果我把它称为快乐周末,它需要同包括双quotes.But我想不包括双引号和精确短语,

My operator is, happy weekend. I want exact phrase from the Twitter API. If I give it as "happy weekend", it takes same including double quotes.But I want excluding double quotes and exact phrase,

鸣叫:祝你周末愉快--------->通过应用程序中抽取
 鸣叫:祝你健康快乐周末--------->不受应用程序中抽取

tweet: I wish you a happy weekend ---------> extracted by application tweet: I wish you a happy and healthy weekend--------->not extracted by application

请帮助我在相同的。

我使用Scala 2.9.3和火花0.7.3。

I am using scala 2.9.3 and spark 0.7.3.

谢谢,
见Reddi

Thanks, Reddi

推荐答案

不幸的是,每的文档,在流API轨道终端不支持精确短语匹配。

Unfortunately, per the documentation, the track endpoint on the Streaming API does not support exact phrase matches.

一个短语可能是用空格分隔的一个或多个方面,如果一切一语中的条款都在鸣叫present,无论秩序和忽略大小写短语匹配。

A phrase may be one or more terms separated by spaces, and a phrase will match if all of the terms in the phrase are present in the Tweet, regardless of order and ignoring case.

您将不得不做一些额外的过滤器在您的斯卡拉code。

You'll have to do some additional filtering in your scala code.

这篇关于无法从星火流应用Twitter的API获取精确短语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆