Skip to content

Commit

Permalink
derive clone for batch comparator (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
Lips7 authored Jun 29, 2024
1 parent a762a8b commit 151f82c
Show file tree
Hide file tree
Showing 12 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/details/matrix.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::ops::{BitAnd, Shl};

#[derive(Clone)]
pub struct BitMatrix<T> {
rows: usize,
cols: usize,
Expand Down
1 change: 1 addition & 0 deletions src/details/pattern_match_vector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ impl BitVectorInterface for PatternMatchVector {
}
}

#[derive(Clone)]
pub struct BlockPatternMatchVector {
pub block_count: usize,
pub map_unsigned: Option<Vec<BitvectorHashmap>>,
Expand Down
1 change: 1 addition & 0 deletions src/distance/damerau_levenshtein.rs
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ where
/// let scorer = damerau_levenshtein::BatchComparator::new("CA".chars());
/// assert_eq!(2, scorer.distance("ABC".chars()));
/// ```
#[derive(Clone)]
pub struct BatchComparator<Elem1> {
s1: Vec<Elem1>,
}
Expand Down
1 change: 1 addition & 0 deletions src/distance/hamming.rs
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ where
/// let scorer = hamming::BatchComparator::new("hamming".chars());
/// assert_eq!(Ok(1), scorer.distance("humming".chars()));
/// ```
#[derive(Clone)]
pub struct BatchComparator<Elem1> {
s1: Vec<Elem1>,
}
Expand Down
1 change: 1 addition & 0 deletions src/distance/indel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ where
/// let scorer = indel::BatchComparator::new("lewenstein".chars());
/// assert_eq!(3, scorer.distance("levenshtein".chars()));
/// ```
#[derive(Clone)]
pub struct BatchComparator<Elem1> {
pub(crate) scorer: lcs_seq::BatchComparator<Elem1>,
}
Expand Down
1 change: 1 addition & 0 deletions src/distance/jaro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,7 @@ where
}

/// `One x Many` comparisons using the Jaro similarity
#[derive(Clone)]
pub struct BatchComparator<Elem1> {
s1: Vec<Elem1>,
pm: BlockPatternMatchVector,
Expand Down
1 change: 1 addition & 0 deletions src/distance/jaro_winkler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ impl<CharT> Metricf64 for BatchComparatorImpl<'_, CharT> {
}

/// `One x Many` comparisons using the Jaro-Winkler similarity
#[derive(Clone)]
pub struct BatchComparator<Elem1> {
s1: Vec<Elem1>,
pm: BlockPatternMatchVector,
Expand Down
1 change: 1 addition & 0 deletions src/distance/lcs_seq.rs
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,7 @@ where
/// let scorer = lcs_seq::BatchComparator::new("lewenstein".chars());
/// assert_eq!(9, scorer.similarity("levenshtein".chars()));
/// ```
#[derive(Clone)]
pub struct BatchComparator<Elem1> {
pub(crate) s1: Vec<Elem1>,
pub(crate) pm: BlockPatternMatchVector,
Expand Down
1 change: 1 addition & 0 deletions src/distance/levenshtein.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,7 @@ impl<CharT> MetricUsize for BatchComparatorImpl<'_, CharT> {
/// let scorer = levenshtein::BatchComparator::new("CA".chars());
/// assert_eq!(3, scorer.distance("ABC".chars()));
/// ```
#[derive(Clone)]
pub struct BatchComparator<Elem1> {
s1: Vec<Elem1>,
pm: BlockPatternMatchVector,
Expand Down
1 change: 1 addition & 0 deletions src/distance/osa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ where
))
}

#[derive(Clone)]
pub struct BatchComparator<Elem1> {
s1: Vec<Elem1>,
pm: BlockPatternMatchVector,
Expand Down
1 change: 1 addition & 0 deletions src/distance/postfix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ where
/// let scorer = postfix::BatchComparator::new("postfix".chars());
/// assert_eq!(3, scorer.similarity("prefix".chars()));
/// ```
#[derive(Clone)]
pub struct BatchComparator<Elem1> {
s1: Vec<Elem1>,
}
Expand Down
1 change: 1 addition & 0 deletions src/distance/prefix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ where
/// let scorer = prefix::BatchComparator::new("prefix".chars());
/// assert_eq!(4, scorer.similarity("preference".chars()));
/// ```
#[derive(Clone)]
pub struct BatchComparator<Elem1> {
s1: Vec<Elem1>,
}
Expand Down

0 comments on commit 151f82c

Please sign in to comment.