0
我有一個錯誤說「不正確可能縮進」Haskell的不正確縮進
boyerMooreSearch :: [Char] -> [Char] -> [Int] -> Int
boyerMooreSearch string pattern skipTable
| skip == 0 = 0
| skip > 0 && (string length > pattern length) = boyerMooreSearch (substring string skip (string length)) pattern skipTable
| otherwise = -1
where
subStr = (substring 0 (pattern length))
skip = (calculateSkip subStr pattern skipTable)
哪些錯誤呢?任何人都可以在Haskell中解釋縮進規則嗎?
只是一句話,博耶/摩爾實際上並不能很好地處理'[Char]',因爲你需要向後走,然後向前跳等等。對於[Char],我會堅持KMP。 –