Changeset 426
- Timestamp:
- Oct 31, 2013 7:36:47 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.1dev/lib/SpellCheck.inc.php
r289 r426 199 199 { 200 200 $corrections = array(); 201 $words = preg_split('/([\W]+?)/', $string, -1, PREG_SPLIT_DELIM_CAPTURE); 201 // Split words on punctuation except apostrophes 202 // http://stackoverflow.com/questions/790596/split-a-text-into-single-words 203 $words = preg_split("/((^\p{P}+)|(\p{P}*\s+\p{P}*)|[\p{Pd}-ââ]+|(\+|(\p{P}+$))/", $string); 202 204 // Remove non-word elements. 203 205 $words = preg_grep('/\w+/', $words);
Note: See TracChangeset
for help on using the changeset viewer.