Ask HN: How do you split strings (to get keywords)?

https://news.ycombinator.com/item?id=733205
by gopher • 17 years ago
2 7 17 years ago

First trial, one splits on whitespace, but this sucks on interpunction and special characters.

Second trial, you use a alpha-numeric whitelist and split on anything else, but what about umlauts? What about hebrew or cyrillic?

Third trial: split on characters < 32, whitespace and interpunction characters; this works somehow but is ugly. What would you do to get keywords from a string?

Related Stories

Loading related stories...

Source preview

news.ycombinator.com