tod
This commit is contained in:
@@ -132,11 +132,15 @@ impl Words {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn last_n_comparable_to_string(&self, n: usize) -> (String, usize) {
|
fn last_n_comparable_to_string(&self, n: usize) -> (String, usize) {
|
||||||
TODO
|
let v = self.to_comparable_words();
|
||||||
|
v = v[(v.len() - n).clamp(0, v.len())..].to_vec();
|
||||||
|
v.iter().map(|x| x.s).collect().join(" "), v[v.len()-1].idx
|
||||||
}
|
}
|
||||||
|
|
||||||
fn first_n_comparable_to_string(&self, n: usize) -> (String, usize){
|
fn first_n_comparable_to_string(&self, n: usize) -> (String, usize){
|
||||||
TODO
|
let v = self.to_comparable_words();
|
||||||
|
v = v[0..n.clamp(0, v.len())].to_vec();
|
||||||
|
v.iter().map(|x| x.s).collect().join(" "), v[0].idx
|
||||||
}
|
}
|
||||||
|
|
||||||
fn comparable_len(&self) -> usize {
|
fn comparable_len(&self) -> usize {
|
||||||
|
|||||||
Reference in New Issue
Block a user