docs: public Lexicon create() throws Exception {
        Lexicon lexicon = new TrieLexicon(caseSensitive, probabilistic, tagAttribute);
        if (resource != null) {
           String base = resource.baseName().replaceFirst("\\.[^\\.]*$", "");
           try (CSVReader reader = CSV.builder().removeEmptyCells().reader(resource)) {
              reader.forEach(row -> {
                 if (row.size() > 0) {
                    String lemma = row.get(0);
                    double probability = 1d;
                    Tag tag = null;
                    SerializablePredicate<HString> constraint = null;
  
                    int nc = 1;
  
  
                    if (tagAttribute != null && this.tag != null) {
                       tag = Cast.as(this.tag);
                    } else if (row.size() > nc && tagAttribute != null && !useResourceNameAsTag) {
                       tag = tagAttribute.getValueType().decode(row.get(nc));
                       if (tag == null) {
                          log.warn("{0} is an invalid {1}, skipping entry {2}.", row.get(nc), tagAttribute.name(), row);
                          return;
                       }
                       nc++;
                    } else if (tagAttribute != null) {
                       tag = tagAttribute.getValueType().decode(base);
                       Preconditions.checkNotNull(tag, base + " is an invalid tag.");
                    }
  
                    if (probabilistic && row.size() > nc && Doubles.tryParse(row.get(nc)) != null) {
                       probability = Double.parseDouble(row.get(nc));
                       nc++;
                    }
  
  
                    if (hasConstraints && row.size() > nc) {
                       try {
                          constraint = QueryToPredicate.parse(row.get(nc));
                       } catch (ParseException e) {
                          if (tag == null) {
                             log.warn("Error parsing constraint {0}, skipping entry {1}.", row.get(nc), row);
                             return;
                          }
                       }
                    }
  
                    lexicon.add(new LexiconEntry(lemma, probability, constraint, tag));
                 }
              });
           }
        }
        return lexicon;
     }