gitea
This commit is contained in:
48
backend/scripts/debug-importance.ts
Normal file
48
backend/scripts/debug-importance.ts
Normal 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();
|
||||
Reference in New Issue
Block a user