Changeset 425
- Timestamp:
- Oct 31, 2013 7:34:46 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/lib/SpellCheck.inc.php
r396 r425 266 266 { 267 267 $corrections = array(); 268 $words = preg_split('/([\W]+?)/', $string, -1, PREG_SPLIT_DELIM_CAPTURE); 268 // Split words on punctuation except apostrophes 269 // http://stackoverflow.com/questions/790596/split-a-text-into-single-words 270 $words = preg_split("/((^\p{P}+)|(\p{P}*\s+\p{P}*)|[\p{Pd}-ââ]+|(\+|(\p{P}+$))/", $string); 269 271 // Remove non-word elements. 270 272 $words = preg_grep('/\w+/', $words);
Note: See TracChangeset
for help on using the changeset viewer.