forked from ModelEarth/team
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_recommendations.rs
More file actions
50 lines (40 loc) · 1.69 KB
/
Copy pathtest_recommendations.rs
File metadata and controls
50 lines (40 loc) · 1.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Test the recommendations functionality
use std::path::Path;
mod recommendations;
fn main() {
println!("Testing Recommendations Feature");
println!("================================");
// Test with the actual Excel file
let excel_path = "preferences/projects/DFC-ActiveProjects.xlsx";
if !Path::new(excel_path).exists() {
println!("❌ Excel file not found: {}", excel_path);
return;
}
println!("✅ Excel file found: {}", excel_path);
// Test preferences
let test_preferences = vec![
"Agriculture".to_string(),
"Technology Innovation".to_string(),
"Financial Inclusion".to_string(),
];
println!("🔍 Testing with preferences: {:?}", test_preferences);
match recommendations::get_recommendations(&test_preferences, excel_path) {
Ok(projects) => {
println!("✅ Successfully loaded {} projects", projects.len());
for (i, project) in projects.iter().enumerate() {
println!("\n📋 Project {}: {}", i + 1, project.project_name);
println!(" Description: {}", project.project_description);
println!(" Department: {}", project.department);
println!(" NAICS Sector: {}", project.naics_sector);
println!(" Committed: ${}", project.committed);
println!(" Country: {}", project.country);
}
if projects.is_empty() {
println!("⚠️ No matching projects found for the given preferences");
}
}
Err(e) => {
println!("❌ Error loading recommendations: {}", e);
}
}
}