CoolFace
Apppublic

sourav-das/stem-separator

sourceHugging Facemitupdated 6mo agoView on Hugging Face
3likes
util.js36 linesDownload Raw Back to lib
1const unicode = require('../lib/unicode')2 3module.exports = {4    isSpaceSeparator (c) {5        return typeof c === 'string' && unicode.Space_Separator.test(c)6    },7 8    isIdStartChar (c) {9        return typeof c === 'string' && (10            (c >= 'a' && c <= 'z') ||11        (c >= 'A' && c <= 'Z') ||12        (c === '$') || (c === '_') ||13        unicode.ID_Start.test(c)14        )15    },16 17    isIdContinueChar (c) {18        return typeof c === 'string' && (19            (c >= 'a' && c <= 'z') ||20        (c >= 'A' && c <= 'Z') ||21        (c >= '0' && c <= '9') ||22        (c === '$') || (c === '_') ||23        (c === '\u200C') || (c === '\u200D') ||24        unicode.ID_Continue.test(c)25        )26    },27 28    isDigit (c) {29        return typeof c === 'string' && /[0-9]/.test(c)30    },31 32    isHexDigit (c) {33        return typeof c === 'string' && /[0-9A-Fa-f]/.test(c)34    },35}36