
/**
 * Training Data for Quote2Contract Chatbot
 * Real conversation examples to improve intent classification
 */

import { Language } from './i18n';

export interface TrainingExample {
  input: string;
  intent: string;
  entities?: Array<{ type: string; value: string }>;
  language: Language;
}

// Actual roofing conversation examples
export const trainingData: TrainingExample[] = [
  // English - Greeting
  { input: "Hi there", intent: "greeting", language: "en" },
  { input: "Hello, can you help me?", intent: "greeting", language: "en" },
  { input: "Good morning", intent: "greeting", language: "en" },
  { input: "Hey, I need some info", intent: "greeting", language: "en" },
  
  // English - Quote Inquiry
  { input: "I need a quote for my roof", intent: "quote_inquiry", language: "en" },
  { input: "Can you give me an estimate?", intent: "quote_inquiry", language: "en" },
  { input: "How much would it cost to replace my roof?", intent: "quote_inquiry", language: "en" },
  { input: "I'm looking for pricing on roof installation", intent: "quote_inquiry", language: "en" },
  { input: "What's the quote for fixing a leaky roof?", intent: "quote_inquiry", language: "en" },
  { input: "I want to get a price estimate", intent: "quote_inquiry", language: "en" },
  
  // English - Pricing
  { input: "What are your rates?", intent: "pricing", language: "en" },
  { input: "How much do you charge per square meter?", intent: "pricing", language: "en" },
  { input: "What's the cost of tile roofing?", intent: "pricing", entities: [{ type: "material", value: "tile" }], language: "en" },
  { input: "Are your prices negotiable?", intent: "pricing", language: "en" },
  
  // English - Services
  { input: "What services do you offer?", intent: "services", language: "en" },
  { input: "Do you do emergency repairs?", intent: "services", entities: [{ type: "service", value: "repair" }], language: "en" },
  { input: "Can you install metal roofs?", intent: "services", entities: [{ type: "material", value: "metal" }], language: "en" },
  { input: "Do you provide maintenance services?", intent: "services", entities: [{ type: "service", value: "maintenance" }], language: "en" },
  { input: "What kind of roofing work do you handle?", intent: "services", language: "en" },
  
  // English - Materials
  { input: "What roofing materials are available?", intent: "roofing_types", language: "en" },
  { input: "Tell me about tile vs shingle roofs", intent: "roofing_types", entities: [{ type: "material", value: "tile" }, { type: "material", value: "shingle" }], language: "en" },
  { input: "Which is better - metal or tile?", intent: "roofing_types", language: "en" },
  { input: "What's the difference between materials?", intent: "roofing_types", language: "en" },
  
  // English - Timeline
  { input: "How long will it take?", intent: "timeline", language: "en" },
  { input: "When can you start the work?", intent: "timeline", language: "en" },
  { input: "What's the project duration?", intent: "timeline", language: "en" },
  { input: "How many days for roof installation?", intent: "timeline", language: "en" },
  
  // English - Payment
  { input: "What payment methods do you accept?", intent: "payment", language: "en" },
  { input: "Do you offer financing?", intent: "payment", language: "en" },
  { input: "Can I pay in installments?", intent: "payment", language: "en" },
  { input: "How do I make a payment?", intent: "payment", language: "en" },
  
  // English - Status
  { input: "Where is my quote?", intent: "contract_status", language: "en" },
  { input: "Can I check my order status?", intent: "contract_status", language: "en" },
  { input: "What's the status of my contract?", intent: "contract_status", language: "en" },
  
  // English - Contact
  { input: "I need to speak to someone", intent: "contact", language: "en" },
  { input: "Can I talk to a human?", intent: "contact", language: "en" },
  { input: "What's your phone number?", intent: "contact", language: "en" },
  { input: "How do I reach you?", intent: "contact", language: "en" },
  
  // English - Complaint
  { input: "I'm not happy with the service", intent: "complaint", language: "en" },
  { input: "This is taking too long", intent: "complaint", language: "en" },
  { input: "The work quality is poor", intent: "complaint", language: "en" },
  { input: "I have a complaint", intent: "complaint", language: "en" },
  
  // English - Feedback
  { input: "Great service!", intent: "feedback", language: "en" },
  { input: "Thank you for your help", intent: "feedback", language: "en" },
  { input: "You guys are amazing", intent: "feedback", language: "en" },
  { input: "Very satisfied with the work", intent: "feedback", language: "en" },
  
  // Afrikaans - Greeting
  { input: "Hallo daar", intent: "greeting", language: "af" },
  { input: "Goeie môre", intent: "greeting", language: "af" },
  { input: "Haai, kan jy my help?", intent: "greeting", language: "af" },
  
  // Afrikaans - Quote Inquiry
  { input: "Ek het 'n kwotasie nodig vir my dak", intent: "quote_inquiry", language: "af" },
  { input: "Kan jy my 'n skatting gee?", intent: "quote_inquiry", language: "af" },
  { input: "Hoeveel sal dit kos om my dak te vervang?", intent: "quote_inquiry", language: "af" },
  
  // Afrikaans - Pricing
  { input: "Wat is julle tariewe?", intent: "pricing", language: "af" },
  { input: "Hoeveel kos dit per vierkante meter?", intent: "pricing", language: "af" },
  
  // Afrikaans - Services
  { input: "Watter dienste bied julle aan?", intent: "services", language: "af" },
  { input: "Doen julle nood herstelwerk?", intent: "services", language: "af" },
  
  // Afrikaans - Timeline
  { input: "Hoe lank sal dit neem?", intent: "timeline", language: "af" },
  { input: "Wanneer kan julle begin?", intent: "timeline", language: "af" },
  
  // Afrikaans - Contact
  { input: "Ek moet met iemand praat", intent: "contact", language: "af" },
  { input: "Wat is julle telefoonnommer?", intent: "contact", language: "af" },
  
  // Afrikaans - Feedback
  { input: "Baie dankie vir julle hulp", intent: "feedback", language: "af" },
  { input: "Uitstekende diens", intent: "feedback", language: "af" },
  
  // Zulu - Greeting
  { input: "Sawubona", intent: "greeting", language: "zu" },
  { input: "Yebo, kunjani?", intent: "greeting", language: "zu" },
  
  // Zulu - Quote Inquiry
  { input: "Ngifuna intengo yophahla lwami", intent: "quote_inquiry", language: "zu" },
  { input: "Ungangithengisela malini?", intent: "quote_inquiry", language: "zu" },
  { input: "Ngingathola isilinganiso senani?", intent: "quote_inquiry", language: "zu" },
  
  // Zulu - Pricing
  { input: "Yimalini amanani enu?", intent: "pricing", language: "zu" },
  { input: "Kubiza malini ukufaka uphahla?", intent: "pricing", language: "zu" },
  
  // Zulu - Services
  { input: "Yiziphi izinsizakalo ezikhona?", intent: "services", language: "zu" },
  { input: "Ningalungisa uphahla?", intent: "services", language: "zu" },
  
  // Zulu - Timeline
  { input: "Kuzothatha isikhathi esingakanani?", intent: "timeline", language: "zu" },
  { input: "Ningaqala nini?", intent: "timeline", language: "zu" },
  
  // Zulu - Contact
  { input: "Ngifuna ukukhuluma nomuntu", intent: "contact", language: "zu" },
  { input: "Nginganithinta kanjani?", intent: "contact", language: "zu" },
  
  // Zulu - Feedback
  { input: "Ngiyabonga kakhulu", intent: "feedback", language: "zu" },
  { input: "Insizakalo enhle", intent: "feedback", language: "zu" },

  // ===== COMPREHENSIVE ROOFING SERVICES =====
  
  // New Roof Installations
  { input: "Do you install concrete tile roofs?", intent: "services", entities: [{ type: "service", value: "concrete tile roofing" }], language: "en" },
  { input: "Can you do clay tile roofing?", intent: "services", entities: [{ type: "service", value: "clay tile roofing" }], language: "en" },
  { input: "I need slate roofing installation", intent: "services", entities: [{ type: "service", value: "slate roofing" }], language: "en" },
  { input: "Do you work with IBR sheets?", intent: "services", entities: [{ type: "service", value: "metal sheet roofing" }], language: "en" },
  { input: "Can you install corrugated metal roofing?", intent: "services", entities: [{ type: "service", value: "metal sheet roofing" }], language: "en" },
  { input: "What about standing seam metal roofs?", intent: "services", entities: [{ type: "service", value: "standing seam metal roofing" }], language: "en" },
  { input: "Do you install asphalt shingles?", intent: "services", entities: [{ type: "service", value: "asphalt shingle roofing" }], language: "en" },
  { input: "Can you do Chromadek roofing?", intent: "services", entities: [{ type: "service", value: "chromadek roofing" }], language: "en" },
  { input: "I need fibre cement roofing", intent: "services", entities: [{ type: "service", value: "fibre cement roofing" }], language: "en" },
  { input: "Do you build light steel frame roofs?", intent: "services", entities: [{ type: "service", value: "light steel frame roofing" }], language: "en" },
  { input: "Can you install thatch roofing?", intent: "services", entities: [{ type: "service", value: "thatch roofing" }], language: "en" },
  
  // Roof Repairs & Maintenance
  { input: "My roof is leaking, can you find the leak?", intent: "services", entities: [{ type: "service", value: "leak detection" }], language: "en" },
  { input: "I need broken tiles replaced", intent: "services", entities: [{ type: "service", value: "tile replacement" }], language: "en" },
  { input: "Can you do tile re-bedding?", intent: "services", entities: [{ type: "service", value: "tile re-bedding" }], language: "en" },
  { input: "My roof ridge needs replacing", intent: "services", entities: [{ type: "service", value: "cement ridge replacement" }], language: "en" },
  { input: "The flashing is damaged", intent: "services", entities: [{ type: "service", value: "flashing repairs" }], language: "en" },
  { input: "I need valley repairs on my roof", intent: "services", entities: [{ type: "service", value: "valley repairs" }], language: "en" },
  { input: "Can you fix structural timber damage?", intent: "services", entities: [{ type: "service", value: "structural timber repairs" }], language: "en" },
  { input: "My roof beams need reinforcement", intent: "services", entities: [{ type: "service", value: "roof beam reinforcement" }], language: "en" },
  { input: "There's ceiling damage from roof leak", intent: "services", entities: [{ type: "service", value: "roof ceiling damage repairs" }], language: "en" },
  
  // Roof Waterproofing
  { input: "Can you waterproof my flat roof?", intent: "services", entities: [{ type: "service", value: "flat roof waterproofing" }], language: "en" },
  { input: "I need torch-on membrane waterproofing", intent: "services", entities: [{ type: "service", value: "torch-on membrane" }], language: "en" },
  { input: "Do you apply liquid rubber waterproofing?", intent: "services", entities: [{ type: "service", value: "liquid rubber waterproofing" }], language: "en" },
  { input: "Can you waterproof my balcony?", intent: "services", entities: [{ type: "service", value: "balcony waterproofing" }], language: "en" },
  { input: "My parapet walls need waterproofing", intent: "services", entities: [{ type: "service", value: "parapet wall waterproofing" }], language: "en" },
  { input: "Do you do acrylic waterproofing systems?", intent: "services", entities: [{ type: "service", value: "acrylic waterproofing" }], language: "en" },
  
  // Roof Coatings & Treatment
  { input: "Can you apply UV resistant coating?", intent: "services", entities: [{ type: "service", value: "UV resistant coating" }], language: "en" },
  { input: "I need thermal reflective coating", intent: "services", entities: [{ type: "service", value: "thermal reflective coating" }], language: "en" },
  { input: "Do you treat roofs for fungus?", intent: "services", entities: [{ type: "service", value: "anti-fungal treatment" }], language: "en" },
  { input: "My metal roof needs rust-proof coating", intent: "services", entities: [{ type: "service", value: "rust-proof coating" }], language: "en" },
  
  // Roof Cleaning
  { input: "Can you high-pressure wash my roof?", intent: "services", entities: [{ type: "service", value: "roof cleaning" }], language: "en" },
  { input: "I need algae removed from my roof", intent: "services", entities: [{ type: "service", value: "algae removal" }], language: "en" },
  { input: "My roof has fungus growing", intent: "services", entities: [{ type: "service", value: "fungus removal" }], language: "en" },
  { input: "Can you clean debris off my roof?", intent: "services", entities: [{ type: "service", value: "debris removal" }], language: "en" },
  
  // Roof Resheeting
  { input: "I need complete roof resheeting", intent: "services", entities: [{ type: "service", value: "roof resheeting" }], language: "en" },
  { input: "Can you strip and replace my roof?", intent: "services", entities: [{ type: "service", value: "full strip and replace" }], language: "en" },
  { input: "The timber battens need renewal", intent: "services", entities: [{ type: "service", value: "timber batten renewal" }], language: "en" },
  { input: "My roof needs bracing and strengthening", intent: "services", entities: [{ type: "service", value: "roof bracing" }], language: "en" },
  
  // Roof Insulation
  { input: "Can you install isoboard insulation?", intent: "services", entities: [{ type: "service", value: "isoboard insulation" }], language: "en" },
  { input: "I need thermal insulation for my roof", intent: "services", entities: [{ type: "service", value: "thermal insulation" }], language: "en" },
  { input: "Do you do spray foam insulation?", intent: "services", entities: [{ type: "service", value: "spray foam insulation" }], language: "en" },
  { input: "I need fire-resistant insulation", intent: "services", entities: [{ type: "service", value: "fire-resistant insulation" }], language: "en" },
  
  // Skylights & Ventilation
  { input: "Can you install tubular skylights?", intent: "services", entities: [{ type: "service", value: "tubular skylights" }], language: "en" },
  { input: "I want dome skylights installed", intent: "services", entities: [{ type: "service", value: "dome skylights" }], language: "en" },
  { input: "Do you install whirlybirds?", intent: "services", entities: [{ type: "service", value: "whirlybirds" }], language: "en" },
  { input: "My attic needs better ventilation", intent: "services", entities: [{ type: "service", value: "attic ventilation" }], language: "en" },
  
  // Solar Roof Preparation
  { input: "Can you prepare my roof for solar panels?", intent: "services", entities: [{ type: "service", value: "solar roof preparation" }], language: "en" },
  { input: "I need mounting brackets for solar", intent: "services", entities: [{ type: "service", value: "solar mounting brackets" }], language: "en" },
  { input: "Can you waterproof cable penetrations?", intent: "services", entities: [{ type: "service", value: "cable penetrations" }], language: "en" },
  { input: "My roof needs reinforcement for PV panels", intent: "services", entities: [{ type: "service", value: "PV load planning" }], language: "en" },
  
  // Emergency Services
  { input: "I need emergency storm damage repair", intent: "services", entities: [{ type: "service", value: "storm damage repairs" }], language: "en" },
  { input: "A tree fell on my roof!", intent: "services", entities: [{ type: "service", value: "fallen tree damage" }], language: "en" },
  { input: "Can you tarp my roof temporarily?", intent: "services", entities: [{ type: "service", value: "temporary tarping" }], language: "en" },
  { input: "I need help with insurance claim for roof", intent: "services", entities: [{ type: "service", value: "insurance claim support" }], language: "en" },
  
  // ===== GUTTER & RAINWATER SERVICES =====
  
  // New Gutter Installations
  { input: "Do you install seamless aluminum gutters?", intent: "services", entities: [{ type: "service", value: "seamless aluminum gutters" }], language: "en" },
  { input: "Can you fit PVC gutters?", intent: "services", entities: [{ type: "service", value: "PVC gutters" }], language: "en" },
  { input: "I need box gutters installed", intent: "services", entities: [{ type: "service", value: "box gutters" }], language: "en" },
  { input: "Do you work with copper gutters?", intent: "services", entities: [{ type: "service", value: "copper gutters" }], language: "en" },
  { input: "Can you install galvanized gutters?", intent: "services", entities: [{ type: "service", value: "galvanized gutters" }], language: "en" },
  
  // Downpipes
  { input: "I need new downpipes installed", intent: "services", entities: [{ type: "service", value: "downpipes" }], language: "en" },
  { input: "Can you install heavy-duty downpipes?", intent: "services", entities: [{ type: "service", value: "heavy-duty downpipes" }], language: "en" },
  { input: "I need water diverters", intent: "services", entities: [{ type: "service", value: "water diverters" }], language: "en" },
  { input: "Can you fit anti-theft downpipe cages?", intent: "services", entities: [{ type: "service", value: "anti-theft cages" }], language: "en" },
  
  // Gutter Repairs
  { input: "My gutter has a leak", intent: "services", entities: [{ type: "service", value: "gutter seal repairs" }], language: "en" },
  { input: "The gutter joints are damaged", intent: "services", entities: [{ type: "service", value: "gutter joint repairs" }], language: "en" },
  { input: "My gutters are sagging", intent: "services", entities: [{ type: "service", value: "sagging gutter correction" }], language: "en" },
  { input: "I need gutter brackets replaced", intent: "services", entities: [{ type: "service", value: "bracket replacement" }], language: "en" },
  { input: "Can you re-align my gutters?", intent: "services", entities: [{ type: "service", value: "gutter re-alignment" }], language: "en" },
  
  // Gutter Cleaning
  { input: "Can you clean my gutters?", intent: "services", entities: [{ type: "service", value: "gutter cleaning" }], language: "en" },
  { input: "My downpipes are blocked", intent: "services", entities: [{ type: "service", value: "downpipe flush cleaning" }], language: "en" },
  { input: "I need leaves removed from gutters", intent: "services", entities: [{ type: "service", value: "leaf removal" }], language: "en" },
  { input: "My gutters have mold growing", intent: "services", entities: [{ type: "service", value: "gutter mold treatment" }], language: "en" },
  
  // Gutter Accessories
  { input: "Do you install leaf guards?", intent: "services", entities: [{ type: "service", value: "leaf guards" }], language: "en" },
  { input: "Can you fit bird-proofing netting?", intent: "services", entities: [{ type: "service", value: "bird-proofing" }], language: "en" },
  { input: "I need anti-leaf brush systems", intent: "services", entities: [{ type: "service", value: "anti-leaf brush" }], language: "en" },
  { input: "Do you install rain chains?", intent: "services", entities: [{ type: "service", value: "rain chains" }], language: "en" },
  
  // Rainwater Harvesting
  { input: "Can you connect gutters to my water tank?", intent: "services", entities: [{ type: "service", value: "rainwater harvesting" }], language: "en" },
  { input: "I need a first flush diverter", intent: "services", entities: [{ type: "service", value: "first flush diverter" }], language: "en" },
  { input: "Can you install leaf filter diverters?", intent: "services", entities: [{ type: "service", value: "leaf filter diverters" }], language: "en" },
  { input: "I need a tank base installed", intent: "services", entities: [{ type: "service", value: "tank base installation" }], language: "en" },
  
  // ===== OTHER SERVICES =====
  
  // Solar Panels
  { input: "Do you install solar panels?", intent: "services", entities: [{ type: "service", value: "solar panel installation" }], language: "en" },
  { input: "Can you do residential solar systems?", intent: "services", entities: [{ type: "service", value: "residential solar" }], language: "en" },
  { input: "I need an off-grid solar solution", intent: "services", entities: [{ type: "service", value: "off-grid solar" }], language: "en" },
  
  // Pools
  { input: "Can you build a concrete pool?", intent: "services", entities: [{ type: "service", value: "concrete pool" }], language: "en" },
  { input: "Do you install fibreglass pools?", intent: "services", entities: [{ type: "service", value: "fibreglass pool" }], language: "en" },
  { input: "I want an infinity pool", intent: "services", entities: [{ type: "service", value: "infinity pool" }], language: "en" },
  
  // Irrigation
  { input: "Can you install drip irrigation?", intent: "services", entities: [{ type: "service", value: "drip irrigation" }], language: "en" },
  { input: "I need a sprinkler system", intent: "services", entities: [{ type: "service", value: "sprinkler system" }], language: "en" },
  { input: "Do you do smart irrigation controllers?", intent: "services", entities: [{ type: "service", value: "smart irrigation" }], language: "en" },
  
  // Paving
  { input: "Can you pave my driveway?", intent: "services", entities: [{ type: "service", value: "driveway paving" }], language: "en" },
  { input: "I need paver blocks installed", intent: "services", entities: [{ type: "service", value: "paver blocks" }], language: "en" },
  { input: "Do you do stamped concrete?", intent: "services", entities: [{ type: "service", value: "stamped concrete" }], language: "en" },
  
  // Fencing
  { input: "Can you install palisade fencing?", intent: "services", entities: [{ type: "service", value: "palisade fencing" }], language: "en" },
  { input: "I need electric fencing", intent: "services", entities: [{ type: "service", value: "electric fencing" }], language: "en" },
  { input: "Do you build precast walls?", intent: "services", entities: [{ type: "service", value: "precast walls" }], language: "en" },
  
  // Renovations
  { input: "Can you renovate my kitchen?", intent: "services", entities: [{ type: "service", value: "kitchen renovation" }], language: "en" },
  { input: "I need a bathroom remodel", intent: "services", entities: [{ type: "service", value: "bathroom renovation" }], language: "en" },
  { input: "Do you do home extensions?", intent: "services", entities: [{ type: "service", value: "extensions" }], language: "en" },
  { input: "Can you convert my garage?", intent: "services", entities: [{ type: "service", value: "garage conversion" }], language: "en" },
  { input: "Do you install laminate flooring?", intent: "services", entities: [{ type: "service", value: "flooring" }], language: "en" },
  { input: "Can you paint my house?", intent: "services", entities: [{ type: "service", value: "painting" }], language: "en" },
  { input: "I need ceiling repairs", intent: "quote_inquiry", entities: [{ type: "service", value: "ceiling repair" }], language: "en" },
  { input: "Can you remove a load-bearing wall?", intent: "services", entities: [{ type: "service", value: "structural work" }], language: "en" },
  { input: "Do you install burglar bars?", intent: "services", entities: [{ type: "service", value: "burglar bars" }], language: "en" },
  { input: "Can you build a granny flat?", intent: "services", entities: [{ type: "service", value: "granny flat" }], language: "en" },
  
  // Solar Panel Services - Comprehensive
  { input: "Do you install solar panels?", intent: "services", entities: [{ type: "service", value: "solar" }], language: "en" },
  { input: "I want to get solar power for my home", intent: "quote_inquiry", entities: [{ type: "service", value: "solar" }], language: "en" },
  { input: "What solar systems do you offer?", intent: "services", entities: [{ type: "service", value: "solar" }], language: "en" },
  { input: "Can you install battery storage?", intent: "services", entities: [{ type: "service", value: "solar battery" }], language: "en" },
  { input: "Do you do solar geyser installations?", intent: "services", entities: [{ type: "service", value: "solar geyser" }], language: "en" },
  { input: "How much does a solar system cost?", intent: "pricing", entities: [{ type: "service", value: "solar" }], language: "en" },
  { input: "Can you integrate solar with my existing system?", intent: "services", entities: [{ type: "service", value: "solar integration" }], language: "en" },
  { input: "Do you clean solar panels?", intent: "services", entities: [{ type: "service", value: "solar cleaning" }], language: "en" },
  { input: "My inverter is broken, can you fix it?", intent: "services", entities: [{ type: "service", value: "inverter repair" }], language: "en" },
  { input: "Do you provide electrical COC certification?", intent: "services", entities: [{ type: "service", value: "COC" }], language: "en" },
  { input: "Can you install a hybrid solar system?", intent: "services", entities: [{ type: "service", value: "hybrid solar" }], language: "en" },
  { input: "Do you install solar pool heating?", intent: "services", entities: [{ type: "service", value: "solar pool heating" }], language: "en" },
  { input: "Can you connect solar to my DB board?", intent: "services", entities: [{ type: "service", value: "DB board integration" }], language: "en" },
  { input: "Do you install Tesla Powerwall?", intent: "services", entities: [{ type: "service", value: "battery storage" }], language: "en" },
  { input: "Can you do ground-mounted solar?", intent: "services", entities: [{ type: "service", value: "ground mount solar" }], language: "en" },
  { input: "Do you install carport solar structures?", intent: "services", entities: [{ type: "service", value: "solar carport" }], language: "en" },
  { input: "Can you check my solar system performance?", intent: "services", entities: [{ type: "service", value: "solar diagnostics" }], language: "en" },
  { input: "My solar panels need cleaning", intent: "quote_inquiry", entities: [{ type: "service", value: "panel cleaning" }], language: "en" },
  
  // Pool Services - Comprehensive
  { input: "Can you build a swimming pool?", intent: "services", entities: [{ type: "service", value: "pool construction" }], language: "en" },
  { input: "I need my pool resurfaced", intent: "quote_inquiry", entities: [{ type: "service", value: "pool resurfacing" }], language: "en" },
  { input: "Do you do pool repairs?", intent: "services", entities: [{ type: "service", value: "pool repair" }], language: "en" },
  { input: "My pool is leaking, can you help?", intent: "services", entities: [{ type: "service", value: "pool leak repair" }], language: "en" },
  { input: "Can you install a pool pump?", intent: "services", entities: [{ type: "service", value: "pool pump" }], language: "en" },
  { input: "Do you offer pool maintenance services?", intent: "services", entities: [{ type: "service", value: "pool maintenance" }], language: "en" },
  { input: "I need a pool heater installed", intent: "quote_inquiry", entities: [{ type: "service", value: "pool heater" }], language: "en" },
  { input: "Can you install pool safety fencing?", intent: "services", entities: [{ type: "service", value: "pool fencing" }], language: "en" },
  { input: "What types of pools do you build?", intent: "services", entities: [{ type: "service", value: "pool construction" }], language: "en" },
  { input: "Do you build infinity pools?", intent: "services", entities: [{ type: "service", value: "infinity pool" }], language: "en" },
  { input: "Can you install a splash pool?", intent: "services", entities: [{ type: "service", value: "splash pool" }], language: "en" },
  { input: "Do you do marbelite resurfacing?", intent: "services", entities: [{ type: "service", value: "marbelite" }], language: "en" },
  { input: "Can you replace my pool filter?", intent: "services", entities: [{ type: "service", value: "pool filter" }], language: "en" },
  { input: "I need weekly pool cleaning", intent: "services", entities: [{ type: "service", value: "pool maintenance" }], language: "en" },
  { input: "Can you balance my pool chemicals?", intent: "services", entities: [{ type: "service", value: "chemical balancing" }], language: "en" },
  { input: "Do you install pool covers?", intent: "services", entities: [{ type: "service", value: "pool covers" }], language: "en" },
  { input: "Can you install a variable speed pump?", intent: "services", entities: [{ type: "service", value: "variable speed pump" }], language: "en" },
  { input: "My pool has cracks", intent: "quote_inquiry", entities: [{ type: "service", value: "crack repair" }], language: "en" },
  
  // Irrigation Services - Comprehensive
  { input: "Can you install an irrigation system?", intent: "services", entities: [{ type: "service", value: "irrigation" }], language: "en" },
  { input: "I need a sprinkler system for my garden", intent: "quote_inquiry", entities: [{ type: "service", value: "sprinkler" }], language: "en" },
  { input: "Do you install drip irrigation?", intent: "services", entities: [{ type: "service", value: "drip irrigation" }], language: "en" },
  { input: "Can you set up smart irrigation controllers?", intent: "services", entities: [{ type: "service", value: "smart irrigation" }], language: "en" },
  { input: "My sprinklers are broken", intent: "quote_inquiry", entities: [{ type: "service", value: "sprinkler repair" }], language: "en" },
  { input: "Do you connect irrigation to boreholes?", intent: "services", entities: [{ type: "service", value: "borehole integration" }], language: "en" },
  { input: "Can you install a booster pump?", intent: "services", entities: [{ type: "service", value: "booster pump" }], language: "en" },
  { input: "I need my irrigation system winterized", intent: "services", entities: [{ type: "service", value: "winterization" }], language: "en" },
  { input: "Do you install pop-up sprinklers?", intent: "services", entities: [{ type: "service", value: "pop-up sprinklers" }], language: "en" },
  { input: "Can you install WiFi controllers?", intent: "services", entities: [{ type: "service", value: "WiFi controllers" }], language: "en" },
  { input: "Do you install soil moisture sensors?", intent: "services", entities: [{ type: "service", value: "moisture sensors" }], language: "en" },
  { input: "Can you design a commercial irrigation system?", intent: "services", entities: [{ type: "service", value: "commercial irrigation" }], language: "en" },
  { input: "I have a zone valve problem", intent: "quote_inquiry", entities: [{ type: "service", value: "valve repair" }], language: "en" },
  { input: "Can you do spring start-up?", intent: "services", entities: [{ type: "service", value: "spring start-up" }], language: "en" },
  
  // Paving Services - Comprehensive
  { input: "Can you pave my driveway?", intent: "services", entities: [{ type: "service", value: "paving" }], language: "en" },
  { input: "I need paving for my patio", intent: "quote_inquiry", entities: [{ type: "service", value: "patio paving" }], language: "en" },
  { input: "What paving materials do you use?", intent: "services", entities: [{ type: "service", value: "paving" }], language: "en" },
  { input: "Can you do exposed aggregate?", intent: "services", entities: [{ type: "service", value: "exposed aggregate" }], language: "en" },
  { input: "Do you install brick pavers?", intent: "services", entities: [{ type: "service", value: "brick pavers" }], language: "en" },
  { input: "My paving is sunken, can you fix it?", intent: "services", entities: [{ type: "service", value: "paving repair" }], language: "en" },
  { input: "Do you pave around pools?", intent: "services", entities: [{ type: "service", value: "pool surround paving" }], language: "en" },
  { input: "Can you do commercial paving?", intent: "services", entities: [{ type: "service", value: "commercial paving" }], language: "en" },
  { input: "Do you install cobblestone?", intent: "services", entities: [{ type: "service", value: "cobblestone" }], language: "en" },
  { input: "Can you install permeable pavers?", intent: "services", entities: [{ type: "service", value: "permeable pavers" }], language: "en" },
  { input: "I need a parking lot paved", intent: "quote_inquiry", entities: [{ type: "service", value: "parking lot" }], language: "en" },
  { input: "Do you do kerb edging?", intent: "services", entities: [{ type: "service", value: "kerb edging" }], language: "en" },
  { input: "Can you replace broken pavers?", intent: "services", entities: [{ type: "service", value: "paver replacement" }], language: "en" },
  { input: "I need entertainment area paving", intent: "quote_inquiry", entities: [{ type: "service", value: "entertainment area" }], language: "en" },
  
  // Fencing Services - Comprehensive
  { input: "Can you install a fence?", intent: "services", entities: [{ type: "service", value: "fencing" }], language: "en" },
  { input: "I need palisade fencing", intent: "quote_inquiry", entities: [{ type: "service", value: "palisade fencing" }], language: "en" },
  { input: "Do you install electric fencing?", intent: "services", entities: [{ type: "service", value: "electric fencing" }], language: "en" },
  { input: "Can you build a boundary wall?", intent: "services", entities: [{ type: "service", value: "boundary wall" }], language: "en" },
  { input: "Do you install automatic gates?", intent: "services", entities: [{ type: "service", value: "automatic gates" }], language: "en" },
  { input: "My gate motor is not working", intent: "services", entities: [{ type: "service", value: "gate motor repair" }], language: "en" },
  { input: "Can you install Vibracrete walls?", intent: "services", entities: [{ type: "service", value: "vibracrete walls" }], language: "en" },
  { input: "Do you do security fencing?", intent: "services", entities: [{ type: "service", value: "security fencing" }], language: "en" },
  { input: "Can you install ClearVu fencing?", intent: "services", entities: [{ type: "service", value: "clearvu fencing" }], language: "en" },
  { input: "Do you install sliding gates?", intent: "services", entities: [{ type: "service", value: "sliding gates" }], language: "en" },
  { input: "Can you install anti-climb spikes?", intent: "services", entities: [{ type: "service", value: "anti-climb spikes" }], language: "en" },
  { input: "Do you install access control systems?", intent: "services", entities: [{ type: "service", value: "access control" }], language: "en" },
  { input: "Can you build a retaining wall?", intent: "services", entities: [{ type: "service", value: "retaining wall" }], language: "en" },
  { input: "I need my gate motor serviced", intent: "quote_inquiry", entities: [{ type: "service", value: "gate motor service" }], language: "en" },
  { input: "Do you install timber fencing?", intent: "services", entities: [{ type: "service", value: "timber fencing" }], language: "en" },
  
  // Multilingual - Afrikaans
  { input: "Installeer julle sonpanele?", intent: "services", entities: [{ type: "service", value: "solar" }], language: "af" },
  { input: "Kan julle 'n swembad bou?", intent: "services", entities: [{ type: "service", value: "pool" }], language: "af" },
  { input: "Kan julle besproeiing installeer?", intent: "services", entities: [{ type: "service", value: "irrigation" }], language: "af" },
  { input: "Kan julle my oprit plaveisel?", intent: "services", entities: [{ type: "service", value: "paving" }], language: "af" },
  { input: "Kan julle 'n heining maak?", intent: "services", entities: [{ type: "service", value: "fencing" }], language: "af" },
  { input: "Kan julle my kombuis renoveer?", intent: "services", entities: [{ type: "service", value: "kitchen" }], language: "af" },
  
  // Multilingual - Zulu
  { input: "Ningafaka amaphaneli elanga?", intent: "services", entities: [{ type: "service", value: "solar" }], language: "zu" },
  { input: "Ningakha ichibi lokuqubha?", intent: "services", entities: [{ type: "service", value: "pool" }], language: "zu" },
  { input: "Ningafaka uhlelo lokufafaza?", intent: "services", entities: [{ type: "service", value: "irrigation" }], language: "zu" },
  { input: "Ningapenda indlela?", intent: "services", entities: [{ type: "service", value: "paving" }], language: "zu" },
  { input: "Ningafaka ucingo?", intent: "services", entities: [{ type: "service", value: "fencing" }], language: "zu" },
  { input: "Ningavuselela ikhishi?", intent: "services", entities: [{ type: "service", value: "kitchen" }], language: "zu" },
  
  // Multilingual - French
  { input: "Installez-vous des panneaux solaires?", intent: "services", entities: [{ type: "service", value: "solar" }], language: "fr" },
  { input: "Pouvez-vous construire une piscine?", intent: "services", entities: [{ type: "service", value: "pool" }], language: "fr" },
  { input: "Pouvez-vous installer un système d'irrigation?", intent: "services", entities: [{ type: "service", value: "irrigation" }], language: "fr" },
  { input: "Pouvez-vous paver mon allée?", intent: "services", entities: [{ type: "service", value: "paving" }], language: "fr" },
  { input: "Pouvez-vous installer une clôture?", intent: "services", entities: [{ type: "service", value: "fencing" }], language: "fr" },
  { input: "Pouvez-vous rénover ma cuisine?", intent: "services", entities: [{ type: "service", value: "kitchen" }], language: "fr" },
  
  // Multilingual - German
  { input: "Installieren Sie Solarpaneele?", intent: "services", entities: [{ type: "service", value: "solar" }], language: "de" },
  { input: "Können Sie einen Pool bauen?", intent: "services", entities: [{ type: "service", value: "pool" }], language: "de" },
  { input: "Können Sie ein Bewässerungssystem installieren?", intent: "services", entities: [{ type: "service", value: "irrigation" }], language: "de" },
  { input: "Können Sie meine Einfahrt pflastern?", intent: "services", entities: [{ type: "service", value: "paving" }], language: "de" },
  { input: "Können Sie einen Zaun installieren?", intent: "services", entities: [{ type: "service", value: "fencing" }], language: "de" },
  { input: "Können Sie meine Küche renovieren?", intent: "services", entities: [{ type: "service", value: "kitchen" }], language: "de" },
  
  // Multilingual - Italian
  { input: "Installate pannelli solari?", intent: "services", entities: [{ type: "service", value: "solar" }], language: "it" },
  { input: "Potete costruire una piscina?", intent: "services", entities: [{ type: "service", value: "pool" }], language: "it" },
  { input: "Potete installare un sistema di irrigazione?", intent: "services", entities: [{ type: "service", value: "irrigation" }], language: "it" },
  { input: "Potete pavimentare il mio vialetto?", intent: "services", entities: [{ type: "service", value: "paving" }], language: "it" },
  { input: "Potete installare una recinzione?", intent: "services", entities: [{ type: "service", value: "fencing" }], language: "it" },
  { input: "Potete ristrutturare la mia cucina?", intent: "services", entities: [{ type: "service", value: "kitchen" }], language: "it" },
];

// Get training examples by language
export function getTrainingExamplesByLanguage(language: 'en' | 'af' | 'zu'): TrainingExample[] {
  return trainingData.filter(ex => ex.language === language);
}

// Calculate intent match score using training data
export function calculateTrainingScore(input: string, intent: string, language: Language): number {
  const examples = trainingData.filter(ex => ex.intent === intent && ex.language === language);
  
  let maxScore = 0;
  const inputLower = input.toLowerCase();
  const inputWords = inputLower.split(/\s+/);
  
  for (const example of examples) {
    const exampleWords = example.input.toLowerCase().split(/\s+/);
    let matchCount = 0;
    
    for (const word of inputWords) {
      if (exampleWords.includes(word)) {
        matchCount++;
      }
    }
    
    const score = matchCount / Math.max(inputWords.length, exampleWords.length);
    maxScore = Math.max(maxScore, score);
  }
  
  return maxScore;
}