This involves various lexicographic analyses: user research, dictionary typology, and a clear structure for presenting and linking the information in the dictionary.
The checking program would simply break text into sentences, check for any matches in the phrase dictionary, and flag suspect phrases and show an alternative.