fn similarity<'a>(&mut self, mut string1: &'a str, mut string2: &'a str) -> Option<f64> {
        let str1_len = GraphemeClusters::new(string1).len();
        if string1.is_empty() {
            return Some(str1_len as f64);
        }

        let mut str2_len = GraphemeClusters::new(string2).len();
        if string2.is_empty() {
            return Some(str2_len as f64);
        }

        if str1_len > str2_len {
            let s = string1;
            string1 = string2;
            string2 = s;

            str2_len = str1_len;
        }

        let (len1, len2, start) = prefix_suffix_prep(string1, string2);
        if len1 == 0 {
            return Some(1.0);
        }

        let distance = DamaerauOSA::core_damerau_levenshtein(string1, string2, len1, len2, start, &mut self.base_char1_costs, &mut self.base_prev_char1_costs);
        if distance.is_some() {
            return similarity(distance.unwrap() as f64, str2_len as f64);
        }
        None
    }
/// <summary>Return Damerau-Levenshtein optimal string alignment similarity
/// between two strings (1 - (damerau distance / len of longer string)).</summary>
/// <param name="string1">One of the strings to compare.</param>
/// <param name="string2">The other string to compare.</param>
/// <returns>The degree of similarity 0 to 1.0, where 0 represents a lack of any
/// noteable similarity, and 1 represents equivalent strings.</returns>
Return Damerau-Levenshtein optimal string alignment similarity
between two strings (1 - (damerau distance / len of longer string)).
One of the strings to compare.
The other string to compare.
The degree of similarity 0 to 1.0, where 0 represents a lack of any
noteable similarity, and 1 represents equivalent strings.
Return Damerau - Levenshtein optimal string alignment similarity between two strings ( 1 - ( damerau distance / len of longer string )) . One of the strings to compare . The other string to compare . The degree of similarity 0 to 1 . 0 where 0 represents a lack of any noteable similarity and 1 represents equivalent strings .
fn similarity<'a>(&mut self, mut string1: &'a str, mut string2: &'a str) -> Option<f64> {
        let str1_len = GraphemeClusters::new(string1).len();
        if string1.is_empty() {
            return Some(str1_len as f64);
        }
        let mut str2_len = GraphemeClusters::new(string2).len();
        if string2.is_empty() {
            return Some(str2_len as f64);
        }
        if str1_len > str2_len {
            let s = string1;
            string1 = string2;
            string2 = s;
            str2_len = str1_len;
        }
        let (len1, len2, start) = prefix_suffix_prep(string1, string2);
        if len1 == 0 {
            return Some(1.0);
        }
        let distance = DamaerauOSA::core_damerau_levenshtein(string1, string2, len1, len2, start, &mut self.base_char1_costs, &mut self.base_prev_char1_costs);
        if distance.is_some() {
            return similarity(distance.unwrap() as f64, str2_len as f64);
        }
        None
    }
fn similarity < ' a > ( & mut self , mut string1 : & ' a str , mut string2 : & ' a str ) -> Option < f64 > { let str1_len = GraphemeClusters :: new ( string1 ) . len ( ) ; if string1 . is_empty ( ) { return Some ( str1_len as f64 ) ; } let mut str2_len = GraphemeClusters :: new ( string2 ) . len ( ) ; if string2 . is_empty ( ) { return Some ( str2_len as f64 ) ; } if str1_len > str2_len { let s = string1 ; string1 = string2 ; string2 = s ; str2_len = str1_len ; } let ( len1 , len2 , start ) = prefix_suffix_prep ( string1 , string2 ) ; if len1 == 0 { return Some ( 1.0 ) ; } let distance = DamaerauOSA :: core_damerau_levenshtein ( string1 , string2 , len1 , len2 , start , & mut self . base_char1_costs , & mut self . base_prev_char1_costs ) ; if distance . is_some ( ) { return similarity ( distance . unwrap ( ) as f64 , str2_len as f64 ) ; } None }
<summary>Return Damerau-Levenshtein optimal string alignment similarity
between two strings (1 - (damerau distance / len of longer string)).</summary>
<param name="string1">One of the strings to compare.</param>
<param name="string2">The other string to compare.</param>
<returns>The degree of similarity 0 to 1.0, where 0 represents a lack of any
noteable similarity, and 1 represents equivalent strings.</returns>
<summary > Return Damerau - Levenshtein optimal string alignment similarity between two strings ( 1 - ( damerau distance / len of longer string )) . < / summary > <param name = " string1 " > One of the strings to compare . < / param > <param name = " string2 " > The other string to compare . < / param > <returns > The degree of similarity 0 to 1 . 0 where 0 represents a lack of any noteable similarity and 1 represents equivalent strings . < / returns >
&mut self
string1
&'a str
string2
&'a str