This commit is contained in:
2026-01-19 08:32:44 +01:00
parent b4f6a83da0
commit 818779ab07
125 changed files with 32456 additions and 21017 deletions

View File

@@ -0,0 +1,48 @@
import { calculateImportanceScore } from '../src/services/importance';
async function run() {
console.log('Testing Importance Score Calculation');
const testCases = [
{
name: 'Case 1: 100% change, short content, main content',
factors: {
changePercentage: 100,
keywordMatches: 0,
isMainContent: true,
isRecurringPattern: false,
contentLength: 200
}
},
{
name: 'Case 2: 100% change, short content, NOT main content',
factors: {
changePercentage: 100,
keywordMatches: 0,
isMainContent: false,
isRecurringPattern: false,
contentLength: 200
}
},
{
name: 'Case 3: 0.1% change, short content',
factors: {
changePercentage: 0.1,
keywordMatches: 0,
isMainContent: true,
isRecurringPattern: false,
contentLength: 50
}
}
];
for (const test of testCases) {
const score = calculateImportanceScore(test.factors);
console.log(`\n${test.name}:`);
console.log(`Factors:`, test.factors);
console.log(`Score: ${score}`);
}
}
run();