INNER CODE UNIT · Go

sum

mb-14/gomarkov · gomarkov.go:142

	sum := arr.sum()
	randN := prng.Intn(sum)
	keys := arr.orderedKeys()
	for _, key := range keys {
		freq := arr[key]
		randN -= freq
		if randN <= 0 {
			return chain.statePool.intMap[key], nil
		}
	}
	return "", nil
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…