static JTextPane ai_tokenizationToTextPane(LS tok) { ret ai_tokenizationToTextPane(fontSizePlus(7, jtextpane()), tok); } static JTextPane ai_tokenizationToTextPane(JTextPane tp, LS tok) { bool spaced = true; for i over tok: { if (!spaced) { appendToTextPane(tp, " "); spaced = true; } S t = tok.get(i); if (empty(t)) continue; SimpleAttributeSet style; if (odd(i)) // C token style = style_background(Color.yellow, style_foreground(Color.black)); else // N token (whitespace) style = style_foreground(Color.lightGray, style_background(colorFromHex("#E0E0E0"))); appendToTextPane(tp, t, style); spaced = false; } ret tp; }