|
|
|
@ -11,7 +11,6 @@ pub fn feed(chain: &mut Chain<String>, what: impl AsRef<str>, bounds: impl std::
|
|
|
|
|
if #[cfg(feature="split-sentance")] {
|
|
|
|
|
let map = Sentance::new_iter(&what) //get each sentance in string
|
|
|
|
|
.map(|what| what.words()
|
|
|
|
|
.filter(|word| !word.is_empty())
|
|
|
|
|
.map(|s| s.to_owned()).collect::<Vec<_>>());
|
|
|
|
|
debug_assert!(!bounds.contains(&0), "Cannot allow 0 size feeds");
|
|
|
|
|
for map in map {// feed each sentance seperately
|
|
|
|
@ -24,8 +23,7 @@ pub fn feed(chain: &mut Chain<String>, what: impl AsRef<str>, bounds: impl std::
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
let map = Sentance::new_iter(&what) //get each sentance in string
|
|
|
|
|
.map(|what| what.words()
|
|
|
|
|
.filter(|word| !word.is_empty()))
|
|
|
|
|
.map(|what| what.words())
|
|
|
|
|
.flatten() // add all into one buffer
|
|
|
|
|
.map(|s| s.to_owned()).collect::<Vec<_>>();
|
|
|
|
|
debug_assert!(!bounds.contains(&0), "Cannot allow 0 size feeds");
|
|
|
|
|