Search code examples
twittercorpuslinguistics

Twitter Search for All Words Ending with... (Corpus Linguistics)


I am using Twitter to a create a corpus and I need to search for Tweets containing specific grammatical constructions with, e.g., verbs ending in -ing.

For example: I would like to search for Tweets containing the construction:

I enjoy + any verb ending in -ing

Results should include all Tweets with any instance of I enjoy + verb ending in -ing, such as "I enjoy swimming," "I enjoy listening to music," etc.

I understand the Twitter API does not support regular expressions, so any ideas are welcome. Thanks!


Solution

  • There are two things you can try.

    The first is creating a list of verbs you want to search for, and then searching for an exact phrase and a list of potential verbs:

    "I enjoy" doing OR eating OR seeing

    https://twitter.com/search?l=&q=%22I%20enjoy%22%20doing%20OR%20eating%20OR%20seeing&src=typd

    The second is to just search for "I enjoy" and then filtering the results client side. I'd suggest using the streaming API for this if you want to get the most results.

    Good luck!