MCPcopy Create free account
hub / github.com/ResearAI/AutoFigure / charCountDict

Function charCountDict

frontend/lib/utils.ts:241–247  ·  view source on GitHub ↗

* Create a character count dictionary from a string * Used for attribute-order agnostic comparison

(str: string)

Source from the content-addressed store, hash-verified

239 * Used for attribute-order agnostic comparison
240 */
241function charCountDict(str: string): Map<string, number> {
242 const dict = new Map<string, number>()
243 for (const char of str) {
244 dict.set(char, (dict.get(char) || 0) + 1)
245 }
246 return dict
247}
248
249/**
250 * Compare two strings by character frequency (order-agnostic)

Callers 1

sameCharFrequencyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected