1 | /**
|
2 | * Remove special characters and returns an array of tokens (words).
|
3 | *
|
4 | * @param {string} input
|
5 | *
|
6 | * @return {array}
|
7 | */
|
8 | module.exports = function (input) {
|
9 | return input
|
10 | .toLowerCase()
|
11 | .replace(/[^a-z0-9á-úñäâàéèëêïîöôùüûœç\- ]+/g, '')
|
12 | .replace('/ {2,}/',' ')
|
13 | .split(' ');
|
14 | };
|