I thought about this and did some experimenting on my own, and I was able to come up with this code:
local function getResults(rates)
local results = {}
for i = string.byte('A'), string.byte('Z') do
local char = string.char(i)
local rate = rates[char] or 0
local amount = type(rate) == "table" and rate.amount or 1
local probability = type(rate) == "table" and rate.rate or rate
table.insert(results, {type = "item", name = "letter-" .. char, amount = amount, probability = probability})
end
return results
end
A probability of 0 is supported in modern factorio, I'm not sure about any other versions but the decompilation of letters into letters works this way. I haven't been able to find the code that defines all the other decompilations, but this at the very least means letter-letter recycling factories should be able to (efficiently) accept sushi belt inputs.