UNPKG

zhilian-auto-hi

Version:

智联招聘自动打招呼工具 - 自动化招聘流程的命令行工具

46 lines (45 loc) 1.5 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.checkKeywordMatch = checkKeywordMatch; exports.checkIgnoreKeywordMatch = checkIgnoreKeywordMatch; /** * 关键字匹配相关工具函数 */ /** * 检查简历文本是否匹配关键字 * @param resumeText 简历文本 * @param keywords 关键字数组 * @returns 匹配结果,包含是否匹配和匹配到的关键字 */ function checkKeywordMatch(resumeText, keywords) { const lowerResumeText = resumeText.toLowerCase(); const matchedKeywords = []; for (const keyword of keywords) { if (lowerResumeText.includes(keyword.toLowerCase())) { matchedKeywords.push(keyword); } } return { isMatch: matchedKeywords.length > 0, matchedKeywords }; } /** * 检查简历文本是否包含忽略关键字 * @param resumeText 简历文本 * @param ignoreKeyWords 忽略关键字数组 * @returns 匹配结果,包含是否匹配到忽略关键字和匹配到的忽略关键字 */ function checkIgnoreKeywordMatch(resumeText, ignoreKeyWords) { const lowerResumeText = resumeText.toLowerCase(); const matchedIgnoreKeywords = []; for (const ignoreKeyword of ignoreKeyWords) { if (lowerResumeText.includes(ignoreKeyword.toLowerCase())) { matchedIgnoreKeywords.push(ignoreKeyword); } } return { isMatch: matchedIgnoreKeywords.length > 0, matchedKeywords: matchedIgnoreKeywords }; }