code: public LanguageProfileBuilder addText(CharSequence text) {
          if (ngramExtractor==null) {
              throw new IllegalStateException("NgramExtractor has not been set yet!");
          }
          for (Map.Entry<String, Integer> entry : ngramExtractor.extractCountedGrams(text).entrySet()) {
              addGram(entry.getKey(), entry.getValue());
          }
          return this;
      }
docs: In order to use this you must set the {@link #ngramExtractor} first.