28 | | tx = tx.replace( t.settings.strip, ' ' ).replace( / | /gi, ' ' ); |
29 | | tx = tx.replace( t.settings.clean, '' ); |
30 | | tx.replace( t.settings[type], function(){tc++;} ); |
| 27 | if ( type == 'w' ) { // word-counting |
| 28 | tx = tx.replace( t.settings.strip, ' ' ).replace( / | /gi, ' ' ); |
| 29 | tx = tx.replace( t.settings.clean, '' ); |
| 30 | tx.replace( t.settings.count, function(){tc++;} ); |
| 31 | } |
| 32 | else if ( type == 'c' ) { // char-counting for asian languages |
| 33 | tx = tx.replace( t.settings.strip, '' ).replace( /^ +| +$/gm, '' ); |
| 34 | tx = tx.replace( / +| | /gi, ' ' ); |
| 35 | tx.replace( /[\S \u00A0\u3000]/g, function(){tc++;} ); |
| 36 | } |