private void populateDictionary(String filename) throws IOException, SAXException, ParserConfigurationException {
        roots = new ArrayList<>();
        SAXParser parser = SAXParserFactory.newInstance().newSAXParser();
        parser.parse(new File(filename), new DefaultHandler() {
            boolean inWord;
            int freq;
            StringBuilder wordBuilder = new StringBuilder(48);

            @Override
            public void startElement(String uri, String localName,
                                     String qName, Attributes attributes) {
                if (qName.equals(TAG_WORD)) {
                    inWord = true;
                    freq = Integer.parseInt(attributes.getValue(0));
                    wordBuilder.setLength(0);
                }
            }

            @Override
            public void characters(char[] data, int offset, int length) {
                // Ignore other whitespace
                if (!inWord) return;
                wordBuilder.append(data, offset, length);
            }

            @Override
            public void endElement(String uri, String localName,
                                   String qName) {
                if (qName.equals(TAG_WORD)) {
                    if (wordBuilder.length() > 1) {
                        addWordTop(wordBuilder.toString(), freq);
                        mWordCount++;
                    }
                    inWord = false;
                }
            }
        });

        System.out.println("Nodes = " + CharNode.sNodes);
    }