code: public static ExtendedPOSDictionary create(InputStream in)
        throws IOException, InvalidFormatException {
  
      final ExtendedPOSDictionary newPosDict = new ExtendedPOSDictionary();
  
      boolean isCaseSensitive = DictionaryEntryPersistor.create(in, entry -> {
  
            String tagString = entry.getAttributes().getValue(ATTR_TAGS);
            String lemmaString = entry.getAttributes().getValue(ATTR_LEMMAS);
            String featString = entry.getAttributes().getValue(ATTR_FEATS);
  
            String[] tags = tagString.split(" ");
            String[] lemmas = lemmaString.split(" ");
            String[] feats = featString.split(" ");
  
            StringList word = entry.getTokens();
  
            if (word.size() != 1)
              throw new InvalidFormatException(
                  "Each entry must have exactly one token! " + word);
  
            if (tags.length != lemmas.length || tags.length != feats.length) {
              throw new InvalidFormatException(
                  "Each entry must have exactly number of tags, lemmas and feats! "
                      + word);
            }
  
            addTriple(newPosDict.dictionary, word.getToken(0),
                createTriple(tags, lemmas, feats));
          });
  
      newPosDict.caseSensitive = isCaseSensitive;
  
      // TODO: The dictionary API needs to be improved to do this better!
      if (!isCaseSensitive) {
        Map<String, List<Triple>> lowerCasedDictionary = new HashMap<String, List<Triple>>();
  
        for (java.util.Map.Entry<String, List<Triple>> entry : newPosDict.dictionary
            .entrySet()) {
          lowerCasedDictionary.put(StringUtil.toLowerCase(entry.getKey()),
              entry.getValue());
        }
  
        newPosDict.dictionary = lowerCasedDictionary;
      }
  
      return newPosDict;
    }
docs: Creates a new {@link ExtendedPOSDictionary} from a provided
  {@link InputStream}.
  
  After creation is finished the provided {@link InputStream} is closed.
  
  @param in
  
  @return the pos dictionary
  
  @throws IOException
  @throws InvalidFormatException