3 ms·
tl;dr: dashes separate words, underscore is word character -- in common interpretation by, for example, Google Search. When implementing any text search or ma
by dexen 15y ago
tl;dr:
dashes separate words, underscore is word character -- in common interpretation by, for example, Google Search.
When implementing any text search or matching, there's matter of what constitues word boundary. Obviously whitespace does, as do some punctuation; but exactly which punctuation should be considered word boundary? There is an document on the subject by Unicode Consortium:
http://www.unicode.org/reports/tr29/ http://www.unicode.org/reports/tr29/
There is one important case where punctuation and whitespace do not constitue word boundary: the hyphen, as used for breaking word in hyphenation. In Unicode, U+2010 Hyphen, U+2011 Non-breaking hyphen and U+002D (Hyphen-minus, the usual `minus' character from keyboard, for backward compatibility with ASCII / ISO8859-*)
- patio11 15y agoObviously whitespace does This has been the beginning of many hilarious conversations. (My first love was natural language processing. My second was Japanese, which treats every whitespace as a tragic waste of a place where you could have fit twenty three strokes.)