feat(scoring): implemented semantic context padding and optimized excerpting v2.76.0
This commit is contained in:
@@ -94,6 +94,21 @@ describe('Scoring Engine Unit Tests (v2.72.0)', () => {
|
||||
expect(duration).toBeLessThan(100); // Tokenizer should be efficient even for long text
|
||||
});
|
||||
|
||||
test('Contextual Completeness: should include adjacent sentences for semantic padding', () => {
|
||||
const content = `
|
||||
도입부 문장입니다.
|
||||
핵심 키워드 성능 최적화가 포함된 문장입니다.
|
||||
마무리 문장입니다.
|
||||
`;
|
||||
const query = ['성능', '최적화'];
|
||||
const excerpt = extractBestExcerpt(content, query, 200);
|
||||
|
||||
// Should include introduction and conclusion due to padding
|
||||
expect(excerpt).toContain('도입부 문장');
|
||||
expect(excerpt).toContain('핵심 키워드');
|
||||
expect(excerpt).toContain('마무리 문장');
|
||||
});
|
||||
|
||||
test('Performance Benchmark: should process 100 documents within threshold', () => {
|
||||
const query = tokenize('performance optimization');
|
||||
const largeDocs = Array.from({ length: 100 }, (_, i) => ({
|
||||
|
||||
Reference in New Issue
Block a user