Title: String searching algorithm for Chinese characters
Tags: python;unicode;cjk;string-search
Question: 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_string_search_algorithm_(Python)#References



Here is another answer: 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.


{'source': 'StackExchangeDataset', 'subset': 'stackoverflow.com', 'metadata': {'AnswerCount': 1, 'CommentCount': 0, 'ContentLicense': 'CC BY-SA 3.0', 'CreationDate': '2010:00:03/24/10', 'FavoriteCount': 1.0, 'PostTypeId': 1, 'Tags': '<python><unicode><cjk><string-search>', 'Title': 'String searching algorithm for Chinese characters', 'ViewCount': 659, 'id': 2506970, 'user_AboutMe': None, 'user_AccountId': 590445.0, 'user_DisplayName': 'Jack Low', 'user_Reputation': 51.0, 'user_Views': 10.0, 'user_id': 268036.0}}