|
@@ -33,6 +33,9 @@ const FINAL_TOKEN = '' as const; |
|
|
|
|
|
|
|
|
export const tokenize = (stringValue: string) => ( |
|
|
export const tokenize = (stringValue: string) => ( |
|
|
stringValue |
|
|
stringValue |
|
|
|
|
|
.toLowerCase() |
|
|
|
|
|
.trim() |
|
|
|
|
|
.replace(/\s+/, ' ') |
|
|
.replace(new RegExp(`${TENS_ONES_SEPARATOR}`, 'g'), ' ') |
|
|
.replace(new RegExp(`${TENS_ONES_SEPARATOR}`, 'g'), ' ') |
|
|
.split(' ') |
|
|
.split(' ') |
|
|
.filter((maybeToken) => maybeToken.length > 0) |
|
|
.filter((maybeToken) => maybeToken.length > 0) |
|
|