#[derive(Debug, PartialEq)]
pub enum AlignmentCell {
Both { left: usize, right: usize }, RightGap { left: usize }, LeftGap { right: usize }, }
pub type Alignment = Vec<AlignmentCell>;
pub struct Alignments {
score: f32,
alignments: Vec<Alignment>
}
impl Alignments {
pub fn new<T>(score: f32, alignments: T) -> Alignments
where T: IntoIterator<Item=Alignment> {
Alignments {
score: score,
alignments: alignments.into_iter().collect()
}
}
pub fn score(&self) -> f32 { self.score }
pub fn iter(&self) -> std::slice::Iter<Alignment> {
self.alignments.iter()
}
pub fn len(&self) -> usize {
self.alignments.len()
}
}
pub trait Aligner {
fn align(&self, a: &str, b: &str) -> Alignments;
}