我在Haskell中實現了Burrows-Wheeler轉換。作爲變換的第一步,將生成所有循環字符串的組合並存儲在矩陣中。我使用Haskell List來構造矩陣。該列表將原始單詞存儲在列表頭上,並將其循環組合存儲在尾部。 Here is an Example of a transformed word 我已經寫輸出所述第一循環串的函數。但是,如果我再次將該函數作爲遞歸調用,則會面臨無限循環。 下
local function fShallowCopy(tData)
local tOutput = {}
for k,v in ipairs(tData) do
tOutput[k] = v
end
return tOutput
end
local function fLexTblSort(tA,tB) --sorter for tabl