开发者

String searching algorithm for Chinese characters

开发者 https://www.devze.com 2022-12-24 16:59 出处:网络
There is Python code available for normal string searching algorithms, such as Boyer-Moore. I am looking to use this on Chinese characters, but it doesn\'t seem like the same implementation would work

There is Python code available for normal string searching algorithms, such as Boyer-Moore. I am looking to use this on Chinese characters, but it doesn't seem like the same implementation would work. What would I do in order to make the algorithm work with Chinese characters? I am referring to this:

http://en.literateprograms.org/Boyer-Moore_st开发者_开发百科ring_search_algorithm_(Python)#References


As long as all your text is in unicodes it should work just fine. The algorithm looks sequence-independent, provided each "element" is one sequence-unit in length.

0

精彩评论

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