-
Notifications
You must be signed in to change notification settings - Fork 8
Keep one-letter skills without corrupting others #50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -115,12 +115,42 @@ function normalizeLines(text) { | |
| .split(/\r?\n/).map((line) => line.replace(/\s+/g, " ").trim()).filter(Boolean); | ||
| } | ||
|
|
||
| // A bullet glyph is stripped on its own, because it never spells anything | ||
| // else and needs no space after it to say so. A dash run or an asterisk | ||
| // stripped that freely would eat into real content, so those still only | ||
| // count as a marker once whitespace after them confirms it. | ||
| // | ||
| // A numbered marker does not get that same whitespace requirement, because | ||
| // requiring it drops the marker's punctuation but not the marker itself: | ||
| // "1.Must know Rust" and "1.) Must know Rust" are common enough copy-paste | ||
| // shapes that a candidate line must not reach the interviewer still wearing | ||
| // its "1." or "1.)". What still has to hold is the reason the whitespace | ||
| // check existed at all -- keeping "5G" and "3D" intact -- and that only | ||
| // needs the digits to be followed by "." or ")": neither of those two ever | ||
| // follows a digit inside an alphanumeric skill, so requiring one before | ||
| // the marker can be dropped is enough on its own, whitespace or not. | ||
| function clean(line) { | ||
| return line.replace(/^[-*•\d.)\s]+/, "").slice(0, textLimit).trim(); | ||
| return line.trimStart() | ||
| .replace(/^(?:(?:-+|\*)\s+|\d+[.)]+(?=\s|\p{L})\s*|•\s*)+/u, "") | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The numbered-marker regex still uses ASCII-only It may be worth tracking in a follow-up PR using |
||
| .slice(0, textLimit).trim(); | ||
| } | ||
|
cubic-dev-ai[bot] marked this conversation as resolved.
|
||
|
|
||
| // A token with no letter is a number, or nothing but punctuation, wearing a | ||
| // list item's clothes, and neither one is a skill on its own. | ||
| // | ||
| // A letter is what makes a token legible as a named thing: "ISO 27001" and | ||
| // "IEEE 754" keep the org name that scopes their number, "5G" and "3D" carry | ||
| // their own label, and a plain "5" or "27001" or "2015" carries no such | ||
| // scope, whether it arrived alone -- "Skills: 2025" -- or split off a shared | ||
| // prefix by parseResume's "," / ";" / "|" split -- "Skills: ISO 27001, | ||
| // 124141, 2015". Either way, there is nothing left to tell whether it is | ||
| // still part of a standard, a separate one, or an unrelated year. Rather | ||
| // than guess, every letterless token is dropped, with no exception: "24/7" | ||
| // and "100%" are the same digit-plus-symbol shape as "-50", "1-2", and | ||
| // "2020-2024", and none of them carry a letter to claim a meaning others | ||
| // would have to guess at. | ||
| function unique(values, max) { | ||
| return [...new Set(values.map(clean).filter((value) => value.length >= 2))].slice(0, max); | ||
| return [...new Set(values.map(clean).filter((value) => /\p{L}/u.test(value)))].slice(0, max); | ||
| } | ||
|
|
||
| function parseJd(lines) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.