import { BicorderClassifier } from './bicorder-classifier.js';
import fs from 'fs';

const modelData = JSON.parse(fs.readFileSync('bicorder_model.json', 'utf8'));
const classifier = new BicorderClassifier(modelData);

console.log('='.repeat(80));
console.log('BICORDER CLASSIFIER - TEST');
console.log('='.repeat(80));

// Test 1
console.log('\nTest 1: Institutional Protocol (e.g., Airport Security)');
console.log('-'.repeat(80));
const institutional = {
  'Design_elite_vs_vernacular': 1,
  'Design_explicit_vs_implicit': 1,
  'Entanglement_flocking_vs_swarming': 1,
  'Entanglement_obligatory_vs_voluntary': 1,
};
const result1 = classifier.predict(institutional);
console.log(JSON.stringify(result1, null, 2));

// Test 2
console.log('\n\nTest 2: Relational Protocol (e.g., Indigenous Practices)');
console.log('-'.repeat(80));
const relational = {
  'Design_elite_vs_vernacular': 9,
  'Entanglement_flocking_vs_swarming': 9,
  'Entanglement_obligatory_vs_voluntary': 9,
};
const result2 = classifier.predict(relational);
console.log(JSON.stringify(result2, null, 2));

console.log('\n\n' + '='.repeat(80));
console.log('✓ JavaScript classifier working correctly!');
console.log('  Model size:', Math.round(fs.statSync('bicorder_model.json').size / 1024), 'KB');
console.log('='.repeat(80));
