public void debugTokenize(OutputStream outputStream, String text) throws IOException {
        ViterbiLattice lattice = viterbiBuilder.build(text);
        List<ViterbiNode> bestPath = viterbiSearcher.search(lattice);

        outputStream.write(viterbiFormatter.format(lattice, bestPath).getBytes(StandardCharsets.UTF_8));
        outputStream.flush();
    }
public void debugTokenize ( OutputStream outputStream , String text ) throws IOException { ViterbiLattice lattice = viterbiBuilder . build ( text ) ; List < ViterbiNode > bestPath = viterbiSearcher . search ( lattice ) ; outputStream . write ( viterbiFormatter . format ( lattice , bestPath ) . getBytes ( StandardCharsets . UTF_8 ) ) ; outputStream . flush ( ) ; }
Tokenizes the provided text and outputs the corresponding Viterbi lattice and the Viterbi path to the provided output stream
<p>
The output is written in <a href="https://en.wikipedia.org/wiki/DOT_(graph_description_language)">DOT</a> format.
<p>
This method is not thread safe

@param outputStream  output stream to write to
@param text  text to tokenize
@throws IOException if an error occurs when writing the lattice and path