feat(canonical-lexicon): MAN kamyon model kodları yapısal + parça terimleri
Some checks failed
QA Gate (P0/P1) / Test affected app (pull_request) Has been cancelled

MAN %32 = Opel gibi metrik yanılsaması (kamyon model tanımlayıcıları
denominatörde). classifyNode: ^\d{1,2}[./]\d ("12.155","10/11.150") + ^\d{2}t
("18T HOCL-SD") → structural (^\d{4,} KULLANILMADI — 362 mapped satırı bozardı).
Parça terimleri: salter/verici→elektrik, tahrik→sanziman (ticari araç + genel).
21/21 test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-05 12:00:03 +03:00
parent 347d9f2ddb
commit 1fcbfdf5d1
2 changed files with 14 additions and 3 deletions

View File

@@ -14,6 +14,14 @@ describe("classifyNode", () => {
expect(classifyNode("astra-h 2004 - 2014")).toBe("structural");
});
it("flags MAN truck model descriptors as structural", () => {
expect(classifyNode("12.155 star")).toBe("structural");
expect(classifyNode("10/11.150 hocl/r")).toBe("structural");
expect(classifyNode("18t hocl-sd")).toBe("structural");
// a real category starting with digits+space (not a truck code) stays part
expect(classifyNode("4 silindirli motor")).toBe("part");
});
it("flags bare Mercedes catalog codes structural and index pages junk", () => {
expect(classifyNode("c442")).toBe("structural");
expect(classifyNode("c105011")).toBe("structural");

View File

@@ -107,7 +107,7 @@ export const LEXICON: Record<string, Bucket> = {
// "sanzuman"/"disli" are Opel spelling variants (şanzıman / dişli).
strong: "sanziman sanzuman vites diferansiyel kardan aktarim transmission gearbox".split(" "),
// 3-char stems (mil…) don't prefix-match their inflections, so list them.
weak: "flans kavrama saft mil mili miller gear disli propeller".split(" "),
weak: "flans kavrama saft mil mili miller gear disli propeller tahrik".split(" "),
},
suspansiyon: {
// "suspensiyon" Opel variant; "dingil" = axle.
@@ -125,7 +125,7 @@ export const LEXICON: Record<string, Bucket> = {
"elektrik alternator jenerator mars sarj role sigorta sensor korna bcm ecu beyin modul aku akusu enstruman gosterge electric electrical electricity".split(
" ",
),
weak: "kablo sinyal silecek tesisat".split(" "),
weak: "kablo sinyal silecek tesisat salter salteri verici vericisi".split(" "),
},
aydinlatma: {
// far/farlar/fari — 3-char "far" only matches exactly; add inflections.
@@ -209,6 +209,9 @@ const CODE_TOKEN = /^[a-z]{1,3}\d{1,3}[a-z]{0,4}(\[[a-z]+\])?$/;
// nodes that also carry a part name ("D765300(22H), LS 7 F, MB SERVO DİREKSİYON"
// → direksiyon) still map via keyword instead of being wrongly dropped.
const MB_CATALOG_CODE = /^[cd]\d{3,}$/;
// MAN truck model descriptors: "12.155 STAR", "10/11.150 HOCL/R", "18T HOCL-SD".
// (Bare "14250"-style codes are NOT matched — ^\d{4,} would hit 362 mapped rows.)
const TRUCK_MODEL_CODE = /^\d{1,2}[./]\d|^\d{2}t[ -]/i;
const DOC_JUNK = new Set([
"teknik literatur talimatlar",
"aletler",
@@ -230,7 +233,7 @@ export function classifyNode(folded: string): NodeKind {
const f = folded.trim();
if (!f || f.length < 3) return "junk";
if (DOC_JUNK.has(f) || DOC_PAGE.test(f)) return "junk";
if (MB_CATALOG_CODE.test(f)) return "structural";
if (MB_CATALOG_CODE.test(f) || TRUCK_MODEL_CODE.test(f)) return "structural";
// NOTE: don't treat a bare ">>" marker as structural — real VW part names
// carry validity-date markers ("pencere camlari d >> - 14.07.2019"); VIN_LIKE
// below catches the actual VIN nodes ("wvwzzz…") without dropping real parts.