src/main/java/com/github/fge/grappa/matchers/trie/TrieBuilder.java
public TrieBuilder addWord(@Nonnull final String word)
    {
        Objects.requireNonNull(word);

        final int length = word.length();

        if (length == 0)
            throw new IllegalArgumentException("a trie cannot have empty "
                + "strings (use EMPTY instead)");
        nrWords++;
        maxLength = Math.max(maxLength, length);
        nodeBuilder.addWord(word);
        return this;
    }
public TrieBuilder addWord(@Nonnull final String word)
    {
        Objects.requireNonNull(word);

        final int length = word.length();

        if (length == 0)
            throw new IllegalArgumentException("a trie cannot have empty "
                + "strings (use EMPTY instead)");
        nrWords++;
        maxLength = Math.max(maxLength, length);
        nodeBuilder.addWord(word);
        return this;
    }
Add one word to the trie

@param word the word to add
@return this
@throws IllegalArgumentException word is empty