Persona K33 B1: the org of GameCult/<name> names no repo

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-11-21 23:55:43 +01:00
commit a8319a7c78

View file

@ -363,11 +363,13 @@ pub(crate) fn reach(asked: &Asked, packet: &Packet, prose: &str, reached: &[Stri
/// Whether `text` names the repo `repo` (lowercase): as a whole repo-name token, case-blind, where a token runs over
/// letters, digits, `-`, `.` and `_`, as a repo name does (`repo_target`), so `GameCult/gamecult-ops#125` names
/// `gamecult-ops` and "ops" names nothing of it. A token's trailing `.`, `-` or `_` (a sentence's full stop) is not part
/// of the name. The one matcher of what repo is in front of her (map 16.25.5), at open and at read.
/// of the name, and the org of `GameCult/<name>` names no repo. The one matcher of what repo is in front of her (map
/// 16.25.5, 16.26), at open and at read.
fn names_repo(text: &str, repo: &str) -> bool {
let text = text.to_lowercase().replace("gamecult/", " ");
text.split(|c: char| !(c.is_alphanumeric() || matches!(c, '-' | '.' | '_')))
.filter(|token| !token.is_empty())
.any(|token| token.eq_ignore_ascii_case(repo) || token.trim_end_matches(['.', '-', '_']).eq_ignore_ascii_case(repo))
.any(|token| token == repo || token.trim_end_matches(['.', '-', '_']) == repo)
}
/// Whether `target` is a digest id: `d` and a number.