/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.commons.text.similarity;

/**
 * <p>
 * Marker interface for <a
 * href='http://en.wikipedia.org/wiki/String_metric'>String Metrics</a>
 * </p>
 *
 * <p>
 * A string metric measures the distance between two text strings.
 * </p>
 *
 * @param <R> return type of the edit distance
 */
public interface StringMetric<R> {

    /**
     * <p>
     * Compares two strings.
     * </p>
     *
     * @param left the first string
     * @param right the second string
     * @return result distance
     */
    R compare(CharSequence left, CharSequence right);

}

/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.apache.commons.text.similarity;

/**
 * Interface for <a
 * href='http://en.wikipedia.org/wiki/String_metric'>String Metrics</a>.
 *
 * <p>
 * A string metric measures the distance between two character sequences. The higher the distance, the lesser the
 * similarity between the two character sequences.
 * </p>
 *
 * @param <R> The type of score used by this StringMetric.
 */
public interface StringMetric<R> {

    /**
     * Compares two CharSequences.
     *
     * @param left the first CharSequence
     * @param right the second CharSequence
     * @return the distance between to two CharSequences
     */
    R compare(CharSequence left, CharSequence right);

}

Clarify wording in StringMetric interface