Skip to content

Counting and Weighting Results

The same matching report rows can contribute different numbers depending on how often they occur and what each occurrence measures.

On QWERTY, can appear once as a report row and many times in the corpus. Compare .count for matching rows with map(...).sum for their occurrence weights. Both use the sfdk filter:

bi.sfdk.count
bi.sfdk.map(1).sum

For a percentage of all bigram occurrences, divide the matching occurrence weight by the total weight of all bigrams with .freq. Multiplying by 100 expresses the fraction as a percentage:

bi.sfdk.freq * 100

In a weighted average, a frequent pair contributes more than a rare one. Divide weighted distance by the weight of the same physical key pairs selected with kp:

bi.sfdk.kp.map(d).sum / bi.sfdk.kp.map(1).sum

contributes its distance times its weight to the numerator and its weight to the denominator. The same projection must supply both. See functions and numeric results for reducers.