(input: &str)
| 25 | |
| 26 | impl Phrase { |
| 27 | pub fn parse(input: &str) -> Self { |
| 28 | use itertools::Itertools; |
| 29 | |
| 30 | let normalized = unidecode(input) |
| 31 | .to_lowercase() |
| 32 | .replace(SPECIAL_CHARS, "") |
| 33 | .replace('-', " ") |
| 34 | .split_whitespace() |
| 35 | .join(" "); |
| 36 | |
| 37 | Self(normalized) |
| 38 | } |
| 39 | |
| 40 | // Used to derive the filename for an index |
| 41 | pub fn basename(&self) -> Option<String> { |
no outgoing calls
no test coverage detected