@Override
    public boolean equals(Object obj) {
        if (!(obj instanceof NGramExpression rhs)) return false;

        if (linguistics == null) {
            if (rhs.linguistics != null) return false;
        } else if (rhs.linguistics != null) {
            if (linguistics.getClass() != rhs.linguistics.getClass()) return false;
        } else {
            return false;
        }
        if (gramSize != rhs.gramSize) return false;
        return true;
    }
Creates an executable ngram expression

@param linguistics the gram splitter to use, or null if this is used for representation and will not be executed
@param gramSize the gram size
indexinglanguage/src/main/java/com/yahoo/vespa/indexinglanguage/expressions/NGramExpression.java