Looks like there are studies that attempted just that, but they have yet to come up with a well working algorithm.
From González-Ibá?ez, R. et al. "Identifying sarcasm in Twitter: a closer look"
Sarcasm and irony are well-studied phenomena in linguistics,
psychology and cognitive science[...]. But in the text mining
literature, automatic detection of sarcasm is considered a difficult
problem [...] and
has been addressed in only a few studies. [...] The work most closely related to ours is that of Davidov et al.
(2010), whose objective was to identify sarcastic and non-sarcastic
utterances in Twitter and in Amazon product reviews. In this paper, we
consider the somewhat harder problem of distinguishing sarcastic tweets from non- sarcastic tweets
They conclude:
Perhaps unsurprisingly, neither the human judges nor the machine
learning techniques perform very well. [...] Our results suggest that lexical features alone are not sufficient for identifying sarcasm and that pragmatic and contextual features merit further study
Here is another recent, relevant paper:
Reyes, A. "From humor recognition to irony detection: The ?gurative language of social media"
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…