A method for detecting errors includes obtaining input data, applying a
knowledge base to the input data, identifying diagnostics associated with
errors in the input data, encapsulating data snippets corresponding to
errors with associated diagnostic codes to obtain encapsulated data
snippets, and outputting encapsulated data snippets.