oreshnik-cli 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +14 -4
- package/dist/cli.js.map +1 -1
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -2092,17 +2092,27 @@ var init_notes_ingestion_service = __esm({
|
|
|
2092
2092
|
}
|
|
2093
2093
|
classifyProject(text, validIds) {
|
|
2094
2094
|
const lower = text.toLowerCase();
|
|
2095
|
-
const
|
|
2095
|
+
const candidates = [];
|
|
2096
2096
|
for (const [pid, keywords] of Object.entries(PROJECT_KEYWORDS)) {
|
|
2097
2097
|
if (!validIds.has(pid)) continue;
|
|
2098
2098
|
for (const kw of keywords) {
|
|
2099
|
-
|
|
2100
|
-
|
|
2099
|
+
const pos = lower.indexOf(kw);
|
|
2100
|
+
if (pos >= 0) {
|
|
2101
|
+
candidates.push({ id: pid, pos });
|
|
2101
2102
|
break;
|
|
2102
2103
|
}
|
|
2103
2104
|
}
|
|
2104
2105
|
}
|
|
2105
|
-
return
|
|
2106
|
+
if (candidates.length === 0) return [];
|
|
2107
|
+
if (candidates.length === 1) return [candidates[0].id];
|
|
2108
|
+
candidates.sort((a, b) => a.pos - b.pos);
|
|
2109
|
+
const first = candidates[0];
|
|
2110
|
+
const nearby = candidates.filter((c) => c.pos - first.pos <= 40);
|
|
2111
|
+
if (nearby.length > 1) {
|
|
2112
|
+
const span = lower.slice(first.pos, first.pos + 40);
|
|
2113
|
+
if (span.includes(" y ") || span.includes(" and ")) return nearby.map((c) => c.id);
|
|
2114
|
+
}
|
|
2115
|
+
return [first.id];
|
|
2106
2116
|
}
|
|
2107
2117
|
classifyOwner(text) {
|
|
2108
2118
|
const lower = text.toLowerCase();
|