Pragmatic idioms such as greetings are often treated as holistic lexical items, i.e. as ``canned text '', and included in the lexicon in full. The same applies to fixed idioms such as Come to think of it, ... in the meaning `I just thought of another relevant point, namely ...'; formulations like I will just come to think of it, ..., Come to consider it, ... etc. do not have idiomatic meaning.
The most complex problems arise in the case of idioms with variant forms, such as If you twist my arm, then ..., i.e. `If you give me a really good reason, then ...', where as a joke forms such as Twist my arm! or even would you mind twisting Fred's arm? have the idiomatic meaning. However, formulations such as Don't twist my arm!, It was my arm that Tony twisted etc. tend to have the literal, rather than the idiomatic meaning.
Idioms may be associated with a specific range of prosodic patterns (intonation patterns; for example, in How do you do?, the words how, the first occurrence of do and you might be emphasised as a joke, but not with the standard pragmatic idiom connotation. In the example given above, if the word twist is given a noticeably stronger accent than arm, the same also applies.
From a more general perspective, so-called functional units (sequences of functional words which behave as a phonological unit) and clitics (functional words which combine with lexical words to form a sequence which behaves as a phonological unit), share a number of properties with idioms in the more traditional sense of the term. Characteristic of these units is that they have special phonological characteristics, with deletion and assimilation of segments to their neighbouring environment.
An example of a functional unit in English is I c'n ... /ak/ for I can /akæn/ in informal, fast speech or particularly unstressed contexts.
An example of a clitic in English is he's /hi:z/ or even /hz/, for he is /hi: z/.
Some cliticised sequences have become lexicalised (i.e. independent lexical items) in informal styles, e.g. can't /ka:nt/ and cannot /k{nt/ for can not /kæn n/.
A general solution to the lexical treatment of idioms is not currently available either for written language processing or spoken language processing, and further research and development is needed in this area in view of the frequency of idioms in actual corpora.