开发者

Are these algorithm implemented in Objective-C Libraries?

开发者 https://www.devze.com 2023-04-06 00:04 出处:网络
I want to know, Are these algorithms开发者_Python百科 implemented in Objective-C Libraries for text search?

I want to know, Are these algorithms开发者_Python百科 implemented in Objective-C Libraries for text search?

  1. Knutt-Morri-Pratt
  2. Boyer-Moore
  3. finite automata


Looking at the source for CFStringFindWithOptionsAndLocale in CFString.c, it seems like it only implements naive search. Depending on how huge the text is, you might actually get away with this.

Regardless, if your passage is sufficiently huge, Boyer-Moore and KMP are still linear time (albeit with a smaller constant factor), you might want to look at implementing a simple disk based full text index. I've done it for a client's project and it really isn't as hard as it sounds.

0

精彩评论

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