(&mut self, id: &ExternalId, phrase: Phrase, name: &str)
| 230 | } |
| 231 | |
| 232 | pub fn remove(&mut self, id: &ExternalId, phrase: Phrase, name: &str) -> Result<()> { |
| 233 | if let Some(paths) = self.index.synonyms.get_mut(&phrase) { |
| 234 | paths.remove(&SynonymEntry { |
| 235 | name: name.to_owned(), |
| 236 | id: id.to_owned(), |
| 237 | }); |
| 238 | if paths.is_empty() { |
| 239 | self.index.synonyms.remove(&phrase); |
| 240 | } |
| 241 | } |
| 242 | Ok(()) |
| 243 | } |
| 244 | |
| 245 | pub fn prefix_matches(&self, token: &Phrase) -> BTreeSet<SynonymEntry> { |
| 246 | self.index.prefix_matches(token) |
no test coverage detected