public void InitializeStuff() {
        try {
            // initialize the Viterbi class
            try {
                v = new Viterbi("corpus_tagset.txt", "corpus_simple_tagset.txt", "datafile.txt");
                parser = new TextParser(v);
            }
            catch (    FileNotFoundException | WrongFormatException | POSNotFoundException ex) {
                v = new Viterbi("backup/corpus_tagset.txt", "backup/corpus_simple_tagset.txt", "backup/datafile.txt");
                parser = new TextParser(v);
            }
            
            // initializes the Dictionary class
            try {
                d = new Dictionary("webster_dictionary.txt");
            }
            catch (FileNotFoundException ex) {
                d = new Dictionary("backup/webster_dictionary.txt");
            }
            
            // initializes the Thesaurus class
            try {
                th = new Thesaurus("thesaurus.txt");
            }
            catch (FileNotFoundException ex) {
                th = new Thesaurus("backup/thesaurus.txt");
            }

            // populates the Legend field of the GUI
            Style style = legendText.addStyle(getColor(0), null);
            StyleConstants.setForeground(style, Color.decode(getColor(0)));
            for (int i=1; i<15; i++)
            {
                style = legendText.addStyle(getColor(i), null);
                StyleConstants.setForeground(style, Color.decode(getColor(i)));
            }
            StyledDocument doc = legendText.getStyledDocument();
            for (int i=0; i<POS.numgIndices(); i++) {
                try {
                    if (i == POS.numgIndices()-1) doc.insertString(doc.getLength(), POS.getgNameBygIndex(i), legendText.getStyle(getColor(i)));
                    else doc.insertString(doc.getLength(), POS.getgNameBygIndex(i)+"\n", legendText.getStyle(getColor(i)));
                } catch (BadLocationException ex) {
                    Logger.getLogger(TextEditor.class.getName()).log(Level.SEVERE, null, ex);
                }
            }

        } catch (    FileNotFoundException | WrongFormatException | POSNotFoundException ex) {
            Logger.getLogger(TextEditor.class.getName()).log(Level.SEVERE, null, ex);
        }
    }