I needed to do some debugging and needed a way to print terms with their attachments. I put the code I used in an extensible class TextTermWriter that can write terms, their annotations, and their attachments. Other implementations of TermWriter can be used to write terms in other formats. The current TextTermWriter implementation writes similar to how the terms implemented toString(), but can be overridden to do write terms differently. This code does not impact any existing code.
I needed to do some debugging and needed a way to print terms with their attachments. I put the code I used in an extensible class
TextTermWriter
that can write terms, their annotations, and their attachments. Other implementations ofTermWriter
can be used to write terms in other formats. The currentTextTermWriter
implementation writes similar to how the terms implementedtoString()
, but can be overridden to do write terms differently. This code does not impact any existing code.