MCPcopy Create free account
hub / github.com/Epic0522/Codex-Remote-Contact / rankStickerNamesByText

Function rankStickerNamesByText

src/server.js:1970–1979  ·  view source on GitHub ↗
(text, stickerCatalog)

Source from the content-addressed store, hash-verified

1968}
1969
1970function rankStickerNamesByText(text, stickerCatalog) {
1971 const normalizedText = normalizeSemanticText(text);
1972 return (stickerCatalog || [])
1973 .map((item) => ({
1974 name: item.name,
1975 score: scoreStickerNameAgainstText(item.name, normalizedText)
1976 }))
1977 .filter((item) => item.score > 0)
1978 .sort((a, b) => b.score - a.score || a.name.localeCompare(b.name, "zh-Hans-CN"));
1979}
1980
1981function scoreStickerNameAgainstText(name, normalizedText) {
1982 const normalizedName = normalizeSemanticText(name);

Callers 1

chooseQqStickerNameFunction · 0.85

Calls 2

normalizeSemanticTextFunction · 0.85

Tested by

no test coverage detected