code: public int numRules() {
      int accumulated = 0;
      for (List<IntTaggedWord> lis : rulesWithWord) {
        accumulated += lis.size();
      }
      return accumulated;
    }
docs: Returns the number of rules (tag rewrites as word) in the Lexicon.
  This method assumes that the lexicon has been initialized.