code: function Lexicon(filename, defaultCategory, defaultCategoryCapitalised) {
                this.lexicon = {};
  
                if (filename) {
                  this.defaultCategory = defaultCategory;
                  // Read lexicon
                  try {
                    var data = fs.readFileSync(filename, 'utf8');
                    if (data[0] === "{") {
                      // Lexicon is in JSON format
                      this.lexicon = JSON.parse(data);
                    }
                    else {
                      // Lexicon is plain text
                      this.parseLexicon(data);
                    }
                    // console.log('Brill_POS_Tagger.read_lexicon: number of lexicon entries read: ' + Object.keys(that.lexicon).length);
                  }
                  catch (error) {
                    console.error(error);
                  }
                  if (defaultCategory) {
                    this.defaultCategory = defaultCategory;
                    if (defaultCategoryCapitalised) {
                      this.defaultCategoryCapitalised = defaultCategoryCapitalised;
                    }
                  }
                }
              }
docs: /*
  Lexicon class
  Copyright (C) 2016 Hugo W.L. ter Doest
  
  This program is free software: you can redistribute it and/or modify
  it under the terms of the GNU General Public License as published by
  the Free Software Foundation, either version 3 of the License, or
  (at your option) any later version.
  
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  GNU General Public License for more details.
  
  You should have received a copy of the GNU General Public License
  along with this program.  If not, see <http://www.gnu.org/licenses/>.
   Parses a lexicon in JSON or text format