MCPcopy Create free account
hub / github.com/emwalker/digraph / synonym_phrase_matches

Method synonym_phrase_matches

backend/src/git/client.rs:349–380  ·  view source on GitHub ↗
(
        &self,
        repo_ids: &RepoIds,
        name: &str,
    )

Source from the content-addressed store, hash-verified

347 }
348
349 pub fn synonym_phrase_matches(
350 &self,
351 repo_ids: &RepoIds,
352 name: &str,
353 ) -> Result<BTreeSet<SynonymMatch>> {
354 let phrase = Phrase::parse(name);
355 let mut matches = BTreeSet::new();
356
357 for &repo_id in repo_ids.iter() {
358 let key = repo_id.index_key(&phrase)?;
359 for entry in &key
360 .synonym_index(self, IndexType::SynonymPhrase, IndexMode::Update)?
361 .full_matches(&phrase)?
362 {
363 if !self.viewer.can_read(repo_id) {
364 continue;
365 }
366
367 if let Some(topic) = self.fetch_topic(repo_id, &entry.id) {
368 matches.insert(SynonymMatch {
369 cycle: false,
370 entry: (*entry).clone(),
371 name: name.to_string(),
372 repo_id,
373 repo_topic: topic,
374 });
375 }
376 }
377 }
378
379 Ok(matches)
380 }
381
382 // The "prefix" argument tells us which repo to look in. The "prefix" in the method name
383 // alludes to the prefix scan that is done to find matching synonyms.

Callers 3

find_matchesMethod · 0.80
countFunction · 0.80
create_distinctFunction · 0.80

Calls 8

parseFunction · 0.85
index_keyMethod · 0.80
full_matchesMethod · 0.80
synonym_indexMethod · 0.80
can_readMethod · 0.80
insertMethod · 0.80
iterMethod · 0.45
fetch_topicMethod · 0.45

Tested by 2

countFunction · 0.64
create_distinctFunction · 0.64