开发者

Does there exist a analogue of the stringsearch package for Data.Text instead of ByteString?

The stringsearch package provides fast find/replace functionality for Haskell ByteStrings. Does there exist corresponding functionality for the text strings defined in the Data.Text package?

The only approaches I can see at the moment involve encoding to UTF8, using stringsearch, and then converting back---which isn't real开发者_如何学运维ly ideal!


Efficient Boyer-Moore search for Text is implemented in the package out of the box. See the source here: http://hackage.haskell.org/packages/archive/text/0.11.1.5/doc/html/src/Data-Text-Search.html

Access to this functionality is through the standard Text API -- splitOn, breakOn, count, replace, and isInfixOf in particular.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜