Update zetahack.js
Browse files- zetahack.js +199 -367
zetahack.js
CHANGED
|
@@ -1,404 +1,236 @@
|
|
| 1 |
function zetahack(input) {
|
| 2 |
const keyDB = {
|
| 3 |
-
'ai': ['ai', 'artificial', 'intelligence', 'neural', 'network', 'machine', 'learning',
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
'
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
'networking': ['networking', 'network', 'tcp', 'ip', 'router', 'switch', 'lan', 'wan', 'vlan',
|
| 12 |
-
'vpn', 'dns', 'dhcp', 'http', 'https', 'ssl', 'tls', 'bandwidth', 'latency'],
|
| 13 |
-
|
| 14 |
-
'programming': ['programming', 'coding', 'javascript', 'python', 'java', 'c++', 'rust', 'go',
|
| 15 |
-
'algorithm', 'data', 'structure', 'oop', 'functional', 'api', 'sdk', 'framework'],
|
| 16 |
-
|
| 17 |
-
'web_development': ['web', 'development', 'html', 'css', 'javascript', 'react', 'vue', 'angular',
|
| 18 |
-
'node', 'express', 'database', 'mongodb', 'mysql', 'postgresql', 'rest', 'api'],
|
| 19 |
-
|
| 20 |
-
'datascience': ['data', 'science', 'analytics', 'big', 'data', 'machine', 'learning', 'statistics',
|
| 21 |
-
'visualization', 'python', 'r', 'pandas', 'numpy', 'sql', 'etl', 'warehouse'],
|
| 22 |
-
|
| 23 |
-
'cloud_computing': ['cloud', 'computing', 'aws', 'azure', 'gcp', 'iaas', 'paas', 'saas', 'serverless',
|
| 24 |
-
'lambda', 'container', 'docker', 'kubernetes', 'microservices', 'api'],
|
| 25 |
-
|
| 26 |
-
'iot': ['iot', 'internet', 'things', 'sensor', 'actuator', 'embedded', 'system', 'arduino', 'raspberry',
|
| 27 |
-
'pi', 'mqtt', 'coap', 'edge', 'computing', 'smart', 'home', 'industrial'],
|
| 28 |
-
|
| 29 |
-
'blockchain': ['blockchain', 'cryptocurrency', 'bitcoin', 'ethereum', 'smart', 'contract', 'defi',
|
| 30 |
-
'nft', 'web3', 'distributed', 'ledger', 'consensus', 'mining', 'wallet'],
|
| 31 |
-
|
| 32 |
-
'quantum': ['quantum', 'computing', 'qubit', 'superposition', 'entanglement', 'decoherence',
|
| 33 |
-
'quantum', 'gate', 'algorithm', 'shor', 'grover', 'quantum', 'supremacy'],
|
| 34 |
-
|
| 35 |
-
'biology': ['biology', 'biological', 'cell', 'dna', 'rna', 'protein', 'enzyme', 'metabolism',
|
| 36 |
-
'genetics', 'genome', 'evolution', 'ecology', 'biodiversity', 'microbiology'],
|
| 37 |
-
|
| 38 |
-
'chemistry': ['chemistry', 'chemical', 'molecule', 'atom', 'element', 'compound', 'reaction',
|
| 39 |
-
'organic', 'inorganic', 'physical', 'quantum', 'chemistry', 'catalyst'],
|
| 40 |
-
|
| 41 |
-
'physics': ['physics', 'quantum', 'mechanics', 'relativity', 'thermodynamics', 'electromagnetism',
|
| 42 |
-
'particle', 'nuclear', 'astrophysics', 'cosmology', 'string', 'theory'],
|
| 43 |
-
|
| 44 |
-
'environment': ['environment', 'ecological', 'sustainability', 'climate', 'change', 'renewable',
|
| 45 |
-
'energy', 'carbon', 'footprint', 'biodiversity', 'conservation'],
|
| 46 |
-
|
| 47 |
-
'transportation': ['transportation', 'autonomous', 'vehicle', 'ev', 'electric', 'vehicle', 'aviation',
|
| 48 |
-
'aerospace', 'logistics', 'supply', 'chain', 'public', 'transit'],
|
| 49 |
-
|
| 50 |
-
'architecture': ['architecture', 'building', 'design', 'sustainable', 'construction', 'urban', 'planning',
|
| 51 |
-
'smart', 'city', 'bim', 'parametric', 'design', 'structural', 'engineering'],
|
| 52 |
-
|
| 53 |
-
'music': ['music', 'audio', 'sound', 'composition', 'production', 'digital', 'audio', 'workstation',
|
| 54 |
-
'synthesis', 'sampling', 'mixing', 'mastering', 'acoustics', 'harmony', 'melody'],
|
| 55 |
-
|
| 56 |
-
'gaming': ['gaming', 'game', 'development', 'unity', 'unreal', 'engine', 'vr', 'ar', 'graphics',
|
| 57 |
-
'rendering', 'gameplay', 'mechanics', 'level', 'design', 'narrative'],
|
| 58 |
-
|
| 59 |
-
'wireless': ['wireless', 'communication', '5g', '6g', 'wifi', 'bluetooth', 'zigbee', 'lora', 'wan',
|
| 60 |
-
'cellular', 'network', 'modulation', 'antenna', 'rf', 'signal'],
|
| 61 |
-
|
| 62 |
-
'medical': ['medical', 'healthcare', 'biomedical', 'diagnostic', 'treatment', 'telemedicine',
|
| 63 |
-
'medical', 'imaging', 'mri', 'ct', 'scan', 'genomic', 'medicine'],
|
| 64 |
-
|
| 65 |
-
'finance': ['finance', 'financial', 'investment', 'trading', 'algorithmic', 'trading', 'fintech',
|
| 66 |
-
'blockchain', 'cryptocurrency', 'risk', 'management', 'portfolio'],
|
| 67 |
-
|
| 68 |
-
'education': ['education', 'educational', 'pedagogy', 'andragogy', 'elearning', 'mooc', 'edtech',
|
| 69 |
-
'adaptive', 'learning', 'gamification', 'curriculum', 'design'],
|
| 70 |
-
|
| 71 |
-
'psychology': ['psychology', 'cognitive', 'behavioral', 'neuroscience', 'psychotherapy', 'clinical',
|
| 72 |
-
'developmental', 'social', 'psychology', 'personality', 'intelligence'],
|
| 73 |
-
|
| 74 |
-
'mathematics': ['mathematics', 'algebra', 'calculus', 'geometry', 'topology', 'number', 'theory',
|
| 75 |
-
'probability', 'statistics', 'optimization', 'linear', 'algebra']
|
| 76 |
};
|
| 77 |
|
| 78 |
-
const
|
| 79 |
-
'ai':
|
| 80 |
-
"Artificial intelligence leverages deep neural architectures with backpropagation optimization to achieve human-level cognitive performance across diverse domains.",
|
| 81 |
-
"Transformer-based models utilize self-attention mechanisms for contextual understanding, enabling state-of-the-art natural language processing capabilities.",
|
| 82 |
-
"Reinforcement learning frameworks employ policy gradient methods and Q-learning to optimize decision-making in complex, dynamic environments.",
|
| 83 |
-
"Generative adversarial networks establish minimax equilibria between generator and discriminator networks for realistic synthetic data generation."
|
| 84 |
-
],
|
| 85 |
-
|
| 86 |
-
'cybersecurity': [
|
| 87 |
-
"Zero-trust architectures implement microsegmentation and continuous authentication to mitigate lateral movement in compromised networks.",
|
| 88 |
-
"Public key infrastructure establishes cryptographic trust chains through certificate authorities and digital signature verification.",
|
| 89 |
-
"Advanced persistent threats employ sophisticated social engineering and polymorphic malware to bypass traditional security controls.",
|
| 90 |
-
"Homomorphic encryption enables computation on ciphertext, preserving data confidentiality during cloud processing operations."
|
| 91 |
-
],
|
| 92 |
-
|
| 93 |
-
'networking': [
|
| 94 |
-
"Software-defined networking decouples control and data planes, enabling programmable network management through centralized controllers.",
|
| 95 |
-
"Border Gateway Protocol employs path vector algorithms for inter-autonomous system routing in global internet infrastructure.",
|
| 96 |
-
"Quality of Service mechanisms implement differentiated services code points for traffic prioritization and bandwidth allocation.",
|
| 97 |
-
"Multiprotocol Label Switching establishes label-switched paths for efficient packet forwarding in carrier-grade networks."
|
| 98 |
-
],
|
| 99 |
-
|
| 100 |
-
'programming': [
|
| 101 |
-
"Functional programming paradigms emphasize immutable data structures and higher-order functions for robust, testable codebases.",
|
| 102 |
-
"Concurrent programming models utilize goroutines and channels for efficient parallel execution and synchronization.",
|
| 103 |
-
"Memory management systems implement garbage collection algorithms with generational hypothesis optimization.",
|
| 104 |
-
"Static type systems provide compile-time verification through Hindley-Milner type inference and parametric polymorphism."
|
| 105 |
-
],
|
| 106 |
-
|
| 107 |
-
'web_development': [
|
| 108 |
-
"Progressive Web Apps implement service workers for offline functionality and web app manifests for native-like installation.",
|
| 109 |
-
"Single Page Applications utilize client-side routing and virtual DOM diffing for seamless user experiences.",
|
| 110 |
-
"GraphQL schemas provide strongly-typed APIs with introspective capabilities and declarative data fetching.",
|
| 111 |
-
"WebAssembly enables near-native performance execution through stack-based virtual machine architecture."
|
| 112 |
-
],
|
| 113 |
-
|
| 114 |
-
'datascience': [
|
| 115 |
-
"Ensemble methods aggregate multiple weak learners through bagging and boosting techniques for improved predictive accuracy.",
|
| 116 |
-
"Dimensionality reduction algorithms employ principal component analysis and t-SNE for feature space visualization.",
|
| 117 |
-
"Time series analysis utilizes autoregressive integrated moving average models for temporal pattern forecasting.",
|
| 118 |
-
"Bayesian inference implements Markov Chain Monte Carlo sampling for posterior distribution estimation."
|
| 119 |
-
],
|
| 120 |
-
|
| 121 |
-
'cloud_computing': [
|
| 122 |
-
"Serverless architectures employ event-driven execution models with automatic scaling and pay-per-use billing.",
|
| 123 |
-
"Container orchestration platforms implement declarative desired state management through etcd distributed key-value stores.",
|
| 124 |
-
"Infrastructure as Code utilizes idempotent configuration management for reproducible environment provisioning.",
|
| 125 |
-
"Microservices architectures enforce bounded contexts and domain-driven design principles for scalable system decomposition."
|
| 126 |
-
],
|
| 127 |
-
|
| 128 |
-
'iot': [
|
| 129 |
-
"Constrained Application Protocol implements RESTful architecture for resource-constrained IoT device communication.",
|
| 130 |
-
"Edge computing frameworks reduce latency through distributed fog computing nodes and local data processing.",
|
| 131 |
-
"Digital twin technology creates virtual representations of physical assets for predictive maintenance and simulation.",
|
| 132 |
-
"LPWAN technologies employ spread spectrum modulation for long-range, low-power IoT connectivity."
|
| 133 |
-
],
|
| 134 |
-
|
| 135 |
-
'blockchain': [
|
| 136 |
-
"Byzantine Fault Tolerance consensus algorithms ensure network integrity despite malicious node behavior in distributed systems.",
|
| 137 |
-
"Elliptic Curve Cryptography generates public-private key pairs for digital signature verification in cryptocurrency transactions.",
|
| 138 |
-
"Merkle Patricia Tries provide efficient cryptographic verification of transaction inclusion in blockchain state databases.",
|
| 139 |
-
"Proof of Stake validators secure networks through economic stake deposition and slashing conditions for misbehavior."
|
| 140 |
-
],
|
| 141 |
-
|
| 142 |
-
'quantum': [
|
| 143 |
-
"Quantum entanglement enables superdense coding and quantum teleportation through non-local correlation phenomena.",
|
| 144 |
-
"Surface code quantum error correction achieves fault tolerance through topological protection and syndrome measurement.",
|
| 145 |
-
"Quantum Fourier transform provides exponential speedup for period finding in Shor's factorization algorithm.",
|
| 146 |
-
"Adiabatic quantum computation utilizes quantum annealing for global optimization problem solving."
|
| 147 |
-
],
|
| 148 |
-
|
| 149 |
-
'biology': [
|
| 150 |
-
"CRISPR-Cas9 systems employ guide RNA and Cas nuclease for precise genome editing through homology-directed repair.",
|
| 151 |
-
"Next-generation sequencing utilizes bridge amplification and fluorescent nucleotide incorporation for high-throughput DNA analysis.",
|
| 152 |
-
"Optogenetics enables neuronal control through channelrhodopsin light-sensitive ion channel expression.",
|
| 153 |
-
"Synthetic biology implements genetic circuit design with promoter engineering and feedback regulation."
|
| 154 |
-
],
|
| 155 |
-
|
| 156 |
-
'chemistry': [
|
| 157 |
-
"Density functional theory calculates electronic structure through Kohn-Sham equations and exchange-correlation functionals.",
|
| 158 |
-
"Retrosynthetic analysis disassembles target molecules into simpler precursors using transform-based strategic bonds.",
|
| 159 |
-
"Supramolecular chemistry employs host-guest interactions and molecular recognition for self-assembling systems.",
|
| 160 |
-
"Organometallic catalysis utilizes transition metal complexes for carbon-carbon bond formation through oxidative addition."
|
| 161 |
-
],
|
| 162 |
-
|
| 163 |
-
'physics': [
|
| 164 |
-
"Quantum field theory describes particle interactions through gauge boson exchange and renormalization group flow.",
|
| 165 |
-
"General relativity models gravitational phenomena through spacetime curvature and Einstein field equations.",
|
| 166 |
-
"Standard Model of particle physics classifies elementary particles through gauge symmetry groups and Higgs mechanism.",
|
| 167 |
-
"Condensed matter physics explores emergent phenomena including superconductivity and topological insulators."
|
| 168 |
-
],
|
| 169 |
-
|
| 170 |
-
'environment': [
|
| 171 |
-
"Life cycle assessment quantifies environmental impacts through inventory analysis and impact category characterization.",
|
| 172 |
-
"Carbon capture technologies employ amine-based absorption and pressure swing adsorption for greenhouse gas sequestration.",
|
| 173 |
-
"Circular economy principles implement material flow analysis and industrial symbiosis for waste elimination.",
|
| 174 |
-
"Renewable energy systems utilize photovoltaic effect and Betz limit optimization for sustainable power generation."
|
| 175 |
-
],
|
| 176 |
-
|
| 177 |
-
'transportation': [
|
| 178 |
-
"Autonomous vehicle systems implement simultaneous localization and mapping with sensor fusion for environmental perception.",
|
| 179 |
-
"Electric vehicle powertrains employ permanent magnet synchronous motors with regenerative braking energy recovery.",
|
| 180 |
-
"Air traffic management utilizes automatic dependent surveillance-broadcast for precise aircraft positioning.",
|
| 181 |
-
"Hyperloop systems achieve reduced pressure tube environments for minimal aerodynamic drag at high velocities."
|
| 182 |
-
],
|
| 183 |
-
|
| 184 |
-
'architecture': [
|
| 185 |
-
"Building Information Modeling implements parametric object-oriented design with clash detection and quantity takeoff.",
|
| 186 |
-
"Passive house standards achieve energy efficiency through thermal bridge-free construction and heat recovery ventilation.",
|
| 187 |
-
"Structural optimization employs topology optimization algorithms for material-efficient load-bearing systems.",
|
| 188 |
-
"Biophilic design principles incorporate nature-connectedness and environmental psychology for occupant well-being."
|
| 189 |
-
],
|
| 190 |
-
|
| 191 |
-
'music': [
|
| 192 |
-
"Digital audio workstations implement non-destructive editing with real-time plugin processing and automation.",
|
| 193 |
-
"Additive synthesis constructs complex timbres through Fourier analysis and harmonic partial summation.",
|
| 194 |
-
"Spatial audio rendering employs head-related transfer functions for three-dimensional sound localization.",
|
| 195 |
-
"Algorithmic composition utilizes Markov chains and genetic algorithms for generative music creation."
|
| 196 |
-
],
|
| 197 |
-
|
| 198 |
-
'gaming': [
|
| 199 |
-
"Real-time rendering employs physically-based rendering with global illumination and subsurface scattering.",
|
| 200 |
-
"Game engines implement entity-component-system architecture for flexible game object management.",
|
| 201 |
-
"Procedural content generation utilizes noise functions and wave function collapse for infinite world creation.",
|
| 202 |
-
"Network synchronization employs deterministic lockstep and client-side prediction for multiplayer consistency."
|
| 203 |
-
],
|
| 204 |
-
|
| 205 |
-
'wireless': [
|
| 206 |
-
"Orthogonal frequency-division multiplexing mitigates multipath fading through cyclic prefix insertion.",
|
| 207 |
-
"Massive MIMO systems achieve spatial multiplexing through precoding and channel state information feedback.",
|
| 208 |
-
"Beamforming techniques employ phased array antennas for directional signal transmission and interference reduction.",
|
| 209 |
-
"Cognitive radio implements spectrum sensing and dynamic spectrum access for efficient frequency utilization."
|
| 210 |
-
],
|
| 211 |
-
|
| 212 |
-
'medical': [
|
| 213 |
-
"Magnetic resonance imaging utilizes nuclear magnetic resonance and gradient coils for soft tissue visualization.",
|
| 214 |
-
"Genome-wide association studies identify single nucleotide polymorphisms correlated with disease susceptibility.",
|
| 215 |
-
"Neural interfaces employ Utah arrays and optrodes for bidirectional brain-computer communication.",
|
| 216 |
-
"Precision medicine implements pharmacogenomics and biomarker identification for personalized treatment regimens."
|
| 217 |
-
],
|
| 218 |
|
| 219 |
-
'
|
| 220 |
-
"Black-Scholes-Merton model prices derivatives through stochastic calculus and risk-neutral valuation.",
|
| 221 |
-
"High-frequency trading implements market microstructure analysis and colocation for latency arbitrage.",
|
| 222 |
-
"Portfolio optimization employs mean-variance analysis and capital asset pricing model for efficient frontier construction.",
|
| 223 |
-
"Risk management utilizes value at risk and expected shortfall for quantitative financial risk assessment."
|
| 224 |
-
],
|
| 225 |
-
|
| 226 |
-
'education': [
|
| 227 |
-
"Constructivist pedagogy emphasizes scaffolded learning and zone of proximal development for knowledge construction.",
|
| 228 |
-
"Adaptive learning systems implement knowledge space theory and Bayesian knowledge tracing for personalized instruction.",
|
| 229 |
-
"Gamification mechanics employ self-determination theory and flow state induction for enhanced learner engagement.",
|
| 230 |
-
"Learning analytics utilize educational data mining and social network analysis for institutional decision support."
|
| 231 |
-
],
|
| 232 |
|
| 233 |
-
'
|
| 234 |
-
"Cognitive behavioral therapy implements cognitive restructuring and behavioral activation for psychopathological treatment.",
|
| 235 |
-
"Functional magnetic resonance imaging measures blood-oxygen-level-dependent signals for neural activity localization.",
|
| 236 |
-
"Dual-process theory differentiates between automatic System 1 and controlled System 2 cognitive processing.",
|
| 237 |
-
"Neuroplasticity mechanisms involve long-term potentiation and dendritic spine remodeling for experience-dependent change."
|
| 238 |
-
],
|
| 239 |
-
|
| 240 |
-
'mathematics': [
|
| 241 |
-
"Category theory abstracts mathematical structures through objects, morphisms, and universal properties.",
|
| 242 |
-
"Galois theory establishes correspondence between field extensions and group theory for polynomial solvability.",
|
| 243 |
-
"Partial differential equations model physical phenomena through separation of variables and characteristic methods.",
|
| 244 |
-
"Computational complexity theory classifies problems through polynomial-time reduction and complexity class hierarchy."
|
| 245 |
-
]
|
| 246 |
};
|
| 247 |
|
| 248 |
-
const
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
|
| 256 |
-
|
| 257 |
-
|
| 258 |
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
|
| 269 |
-
|
| 270 |
-
|
| 271 |
-
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
const wordConnections = {
|
| 275 |
-
'artificial intelligence leverages': ['deep', 'sophisticated', 'advanced', 'complex'],
|
| 276 |
-
'neural architectures with': ['backpropagation', 'attention', 'convolutional', 'recurrent'],
|
| 277 |
-
'transformer-based models': ['utilize', 'implement', 'leverage', 'employ'],
|
| 278 |
-
'self-attention mechanisms': ['enable', 'facilitate', 'allow', 'permit'],
|
| 279 |
-
'reinforcement learning': ['frameworks', 'algorithms', 'systems', 'methods'],
|
| 280 |
-
'generative adversarial': ['networks', 'models', 'systems', 'architectures'],
|
| 281 |
-
'zero-trust architectures': ['implement', 'utilize', 'employ', 'leverage'],
|
| 282 |
-
'public key': ['infrastructure', 'cryptography', 'encryption', 'authentication'],
|
| 283 |
-
'advanced persistent': ['threats', 'attacks', 'campaigns', 'operations'],
|
| 284 |
-
'software-defined networking': ['decouples', 'separates', 'divides', 'splits'],
|
| 285 |
-
'border gateway protocol': ['employs', 'uses', 'utilizes', 'implements'],
|
| 286 |
-
'quality of service': ['mechanisms', 'protocols', 'systems', 'methods'],
|
| 287 |
-
'functional programming': ['paradigms', 'languages', 'systems', 'approaches'],
|
| 288 |
-
'concurrent programming': ['models', 'systems', 'languages', 'frameworks'],
|
| 289 |
-
'memory management': ['systems', 'algorithms', 'techniques', 'methods'],
|
| 290 |
-
'progressive web': ['apps', 'applications', 'platforms', 'systems'],
|
| 291 |
-
'single page': ['applications', 'interfaces', 'systems', 'platforms'],
|
| 292 |
-
'graphql schemas': ['provide', 'offer', 'deliver', 'supply'],
|
| 293 |
-
'ensemble methods': ['aggregate', 'combine', 'integrate', 'merge'],
|
| 294 |
-
'dimensionality reduction': ['algorithms', 'techniques', 'methods', 'approaches']
|
| 295 |
};
|
| 296 |
|
| 297 |
-
const
|
| 298 |
-
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
'
|
| 302 |
-
"I'm ZetaHack, a sophisticated AI system with specialized knowledge across multiple domains!",
|
| 303 |
-
"I'm ZetaHack, your knowledgeable companion for exploring complex topics together.",
|
| 304 |
-
"I'm ZetaHack, built with an extensive knowledge base and dynamic response generation.",
|
| 305 |
-
"I'm ZetaHack, designed to provide insightful perspectives across science, technology, and beyond!"
|
| 306 |
-
],
|
| 307 |
-
'what are you': [
|
| 308 |
-
"I'm ZetaHack, an advanced AI system running on pure JavaScript with comprehensive domain expertise!",
|
| 309 |
-
"I'm ZetaHack, a knowledge engine capable of discussing everything from quantum computing to web development!",
|
| 310 |
-
"I'm ZetaHack, your gateway to understanding complex concepts through dynamic, personalized responses!"
|
| 311 |
-
]
|
| 312 |
};
|
| 313 |
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
}
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 327 |
}
|
|
|
|
| 328 |
}
|
| 329 |
}
|
| 330 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 331 |
}
|
| 332 |
|
| 333 |
-
function
|
| 334 |
-
const
|
| 335 |
-
|
| 336 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 337 |
|
| 338 |
-
|
| 339 |
-
|
| 340 |
-
|
| 341 |
-
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 345 |
}
|
| 346 |
|
| 347 |
-
|
| 348 |
-
return matches / maxLength;
|
| 349 |
}
|
| 350 |
|
| 351 |
-
function
|
| 352 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 353 |
}
|
| 354 |
|
| 355 |
-
function
|
| 356 |
-
|
| 357 |
-
|
| 358 |
-
return topic;
|
| 359 |
-
}
|
| 360 |
-
}
|
| 361 |
-
return 'ai';
|
| 362 |
}
|
| 363 |
|
| 364 |
-
function
|
| 365 |
-
const
|
| 366 |
-
return
|
| 367 |
}
|
| 368 |
|
| 369 |
-
function
|
| 370 |
-
const
|
| 371 |
-
|
| 372 |
-
|
| 373 |
-
|
| 374 |
-
|
| 375 |
-
|
| 376 |
-
|
| 377 |
-
|
| 378 |
-
|
| 379 |
-
|
| 380 |
-
|
| 381 |
-
return newWords.join(' ');
|
| 382 |
}
|
| 383 |
}
|
| 384 |
|
| 385 |
-
|
|
|
|
|
|
|
|
|
|
| 386 |
}
|
| 387 |
|
| 388 |
-
|
| 389 |
-
|
| 390 |
-
|
| 391 |
-
|
| 392 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 393 |
}
|
| 394 |
|
| 395 |
-
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
|
| 399 |
-
|
| 400 |
-
|
| 401 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 402 |
|
| 403 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 404 |
}
|
|
|
|
| 1 |
function zetahack(input) {
|
| 2 |
const keyDB = {
|
| 3 |
+
'ai': ['ai', 'artificial', 'intelligence', 'neural', 'network', 'machine', 'learning', 'deep', 'algorithm', 'model', 'training', 'chatbot', 'llm', 'transformer', 'gpt', 'robot', 'automation'],
|
| 4 |
+
'math': ['math', 'mathematics', 'calculate', 'equation', 'formula', 'number', 'plus', 'minus', 'multiply', 'divide', 'add', 'subtract', 'times', 'square', 'root', 'algebra', 'geometry', 'calculus'],
|
| 5 |
+
'emotion': ['sad', 'happy', 'angry', 'excited', 'depressed', 'anxious', 'worried', 'stressed', 'tired', 'exhausted', 'feel', 'feeling', 'emotion', 'emotional'],
|
| 6 |
+
'greeting': ['hi', 'hello', 'hey', 'greetings', 'howdy', 'good morning', 'good afternoon', 'good evening'],
|
| 7 |
+
'identity': ['who are you', 'what are you', 'your name', 'introduce yourself'],
|
| 8 |
+
'weather': ['weather', 'temperature', 'rain', 'sunny', 'cloudy', 'hot', 'cold'],
|
| 9 |
+
'time': ['time', 'clock', 'hour', 'minute', 'today', 'tomorrow', 'yesterday'],
|
| 10 |
+
'philosophy': ['life', 'meaning', 'purpose', 'existence', 'universe', 'reality', 'truth', 'knowledge', 'wisdom']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
};
|
| 12 |
|
| 13 |
+
const knowledgeBase = {
|
| 14 |
+
'ai': `Artificial intelligence represents the pinnacle of computational systems designed to emulate human cognitive functions through sophisticated algorithms and neural architectures. Modern AI systems leverage transformer-based models with multi-head self-attention mechanisms to process and understand complex patterns in data. These systems employ deep learning techniques including convolutional neural networks for spatial data, recurrent networks for sequential data, and generative adversarial networks for creative tasks. The fundamental principle underlying AI development involves training models on vast datasets using backpropagation and gradient descent optimization to minimize loss functions and maximize predictive accuracy. Current research focuses on few-shot learning, meta-learning, and neuro-symbolic integration to create more efficient and interpretable AI systems capable of reasoning, planning, and transferring knowledge across domains while addressing ethical considerations and alignment with human values.`,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
'math': `Mathematics constitutes the formal language of patterns, structures, and logical relationships that underpin all scientific and engineering disciplines. The field encompasses diverse branches including algebra dealing with symbolic manipulations and equations, geometry studying spatial relationships and shapes, calculus analyzing continuous change through derivatives and integrals, number theory exploring properties of integers, and probability quantifying uncertainty and random phenomena. Mathematical reasoning relies on rigorous proof techniques, axiomatic systems, and formal logic to establish irrefutable truths. Modern applications span cryptography securing digital communications, optimization algorithms driving efficiency in operations, machine learning models processing complex datasets, and quantum computing leveraging superposition and entanglement for exponential speedups in specific computational tasks.`,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
+
'philosophy': `Philosophical inquiry examines fundamental questions concerning existence, knowledge, values, reason, mind, and language through systematic critical analysis. Major branches include metaphysics investigating the nature of reality and being, epistemology exploring the origins and limits of knowledge, ethics examining moral principles and values, logic studying valid reasoning and argumentation, and aesthetics considering the nature of beauty and art. Philosophical methodologies range from analytical approaches emphasizing conceptual clarity and logical rigor to continental traditions focusing on lived experience and historical context. Contemporary philosophical discourse engages with artificial intelligence consciousness, technological ethics, environmental philosophy, and the intersection of cognitive science with traditional mind-body problems while maintaining the Socratic tradition of questioning assumptions and pursuing wisdom through dialectical exchange.`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 19 |
};
|
| 20 |
|
| 21 |
+
const emotionalSupport = {
|
| 22 |
+
sad: [
|
| 23 |
+
"I understand this feels heavy right now. Even in difficult moments, there's strength in simply continuing forward.",
|
| 24 |
+
"Your feelings are completely valid. Sometimes the bravest thing we can do is acknowledge when we're struggling.",
|
| 25 |
+
"This sounds really challenging. Remember that difficult emotions, like clouds, eventually pass and make way for clearer skies.",
|
| 26 |
+
"I hear the pain in your words. Be gentle with yourself - healing isn't linear and every small step matters."
|
| 27 |
+
],
|
| 28 |
+
stressed: [
|
| 29 |
+
"It sounds like you're carrying a lot right now. Remember to breathe deeply - even brief pauses can reset your perspective.",
|
| 30 |
+
"When everything feels overwhelming, focus on just the next small step rather than the entire journey ahead.",
|
| 31 |
+
"Your mind is working hard to process everything. Sometimes the most productive thing is to step away and return with fresh eyes.",
|
| 32 |
+
"Pressure can feel immense, but you've navigated challenges before. Trust in your resilience and take things one moment at a time."
|
| 33 |
+
],
|
| 34 |
+
tired: [
|
| 35 |
+
"Your energy is precious. Consider what truly needs your attention right now and what can wait for restored vitality.",
|
| 36 |
+
"Rest isn't a reward for finishing everything - it's a necessary fuel for the journey. Your worth isn't measured by productivity.",
|
| 37 |
+
"Even machines need maintenance. Your need for rest signals your humanity, not any deficiency in capability or character.",
|
| 38 |
+
"The world will still be there after you recharge. Sometimes the most strategic move is intentional recovery."
|
| 39 |
+
],
|
| 40 |
+
general: [
|
| 41 |
+
"You're navigating complex challenges with thoughtfulness and care - that in itself is an accomplishment.",
|
| 42 |
+
"Your perspective matters, and your experiences are shaping you into someone uniquely equipped to handle what comes.",
|
| 43 |
+
"Progress often happens in subtle ways we don't immediately recognize. Trust that your efforts are accumulating.",
|
| 44 |
+
"The fact that you're reflecting on these things shows remarkable self-awareness and growth mindset."
|
| 45 |
+
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 46 |
};
|
| 47 |
|
| 48 |
+
const mathExpressions = {
|
| 49 |
+
add: ['plus', 'add', 'sum', '+', 'and', 'total'],
|
| 50 |
+
subtract: ['minus', 'subtract', 'take away', 'difference', '-', 'less'],
|
| 51 |
+
multiply: ['times', 'multiply', 'product', '*', 'x', 'by'],
|
| 52 |
+
divide: ['divide', 'divided by', 'over', 'quotient', '/', '÷']
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 53 |
};
|
| 54 |
|
| 55 |
+
const responseStyles = [
|
| 56 |
+
(content) => `From an analytical perspective, ${content}`,
|
| 57 |
+
(content) => `Considering the broader context, ${content}`,
|
| 58 |
+
(content) => `Through systematic examination, ${content}`,
|
| 59 |
+
(content) => `From an integrated viewpoint, ${content}`,
|
| 60 |
+
(content) => `Drawing upon multiple frameworks, ${content}`,
|
| 61 |
+
(content) => `Within the current paradigm, ${content}`,
|
| 62 |
+
(content) => `Through careful analysis, ${content}`,
|
| 63 |
+
(content) => `From an evidence-based approach, ${content}`
|
| 64 |
+
];
|
| 65 |
+
|
| 66 |
+
function detectIntent(text) {
|
| 67 |
+
const lowerText = text.toLowerCase();
|
| 68 |
+
const words = lowerText.split(/\s+/);
|
| 69 |
+
|
| 70 |
+
for (const [category, keywords] of Object.entries(keyDB)) {
|
| 71 |
+
if (keywords.some(keyword => lowerText.includes(keyword))) {
|
| 72 |
+
if (category === 'math' && hasMathOperation(lowerText)) {
|
| 73 |
+
return 'math_calculation';
|
| 74 |
}
|
| 75 |
+
return category;
|
| 76 |
}
|
| 77 |
}
|
| 78 |
+
|
| 79 |
+
if (isEmotional(lowerText)) return 'emotional_support';
|
| 80 |
+
if (isGreeting(lowerText)) return 'greeting';
|
| 81 |
+
if (isIdentityQuery(lowerText)) return 'identity';
|
| 82 |
+
|
| 83 |
+
return 'general';
|
| 84 |
}
|
| 85 |
|
| 86 |
+
function hasMathOperation(text) {
|
| 87 |
+
const mathWords = [...mathExpressions.add, ...mathExpressions.subtract, ...mathExpressions.multiply, ...mathExpressions.divide];
|
| 88 |
+
return mathWords.some(word => text.includes(word)) || /\d+[\+\-\*\/]\d+/.test(text);
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
function isEmotional(text) {
|
| 92 |
+
const emotionalWords = keyDB.emotion;
|
| 93 |
+
return emotionalWords.some(word => text.includes(word));
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
function isGreeting(text) {
|
| 97 |
+
const greetings = keyDB.greeting;
|
| 98 |
+
return greetings.some(word => text.includes(word));
|
| 99 |
+
}
|
| 100 |
+
|
| 101 |
+
function isIdentityQuery(text) {
|
| 102 |
+
const identityQueries = keyDB.identity;
|
| 103 |
+
return identityQueries.some(query => text.includes(query));
|
| 104 |
+
}
|
| 105 |
+
|
| 106 |
+
function performMathCalculation(text) {
|
| 107 |
+
const lowerText = text.toLowerCase();
|
| 108 |
+
const numbers = text.match(/\d+/g) || [];
|
| 109 |
|
| 110 |
+
if (numbers.length < 2) return null;
|
| 111 |
+
|
| 112 |
+
const num1 = parseInt(numbers[0]);
|
| 113 |
+
const num2 = parseInt(numbers[1]);
|
| 114 |
+
|
| 115 |
+
if (mathExpressions.add.some(op => lowerText.includes(op))) {
|
| 116 |
+
return { operation: 'addition', result: num1 + num2, numbers: [num1, num2] };
|
| 117 |
+
}
|
| 118 |
+
if (mathExpressions.subtract.some(op => lowerText.includes(op))) {
|
| 119 |
+
return { operation: 'subtraction', result: num1 - num2, numbers: [num1, num2] };
|
| 120 |
+
}
|
| 121 |
+
if (mathExpressions.multiply.some(op => lowerText.includes(op))) {
|
| 122 |
+
return { operation: 'multiplication', result: num1 * num2, numbers: [num1, num2] };
|
| 123 |
+
}
|
| 124 |
+
if (mathExpressions.divide.some(op => lowerText.includes(op))) {
|
| 125 |
+
return { operation: 'division', result: num1 / num2, numbers: [num1, num2] };
|
| 126 |
}
|
| 127 |
|
| 128 |
+
return null;
|
|
|
|
| 129 |
}
|
| 130 |
|
| 131 |
+
function generateMathResponse(mathResult) {
|
| 132 |
+
const templates = [
|
| 133 |
+
`After careful computation, the ${mathResult.operation} of ${mathResult.numbers[0]} and ${mathResult.numbers[1]} yields ${mathResult.result}`,
|
| 134 |
+
`Mathematical analysis confirms that ${mathResult.numbers[0]} ${getOperationSymbol(mathResult.operation)} ${mathResult.numbers[1]} equals ${mathResult.result}`,
|
| 135 |
+
`The calculated result for this ${mathResult.operation} problem is ${mathResult.result}, derived from operands ${mathResult.numbers[0]} and ${mathResult.numbers[1]}`,
|
| 136 |
+
`Through numerical computation, I've determined that ${mathResult.numbers[0]} operated with ${mathResult.numbers[1]} produces ${mathResult.result}`,
|
| 137 |
+
`The mathematical operation yields: ${mathResult.numbers[0]} ${getOperationWord(mathResult.operation)} ${mathResult.numbers[1]} = ${mathResult.result}`
|
| 138 |
+
];
|
| 139 |
+
|
| 140 |
+
return templates[Math.floor(Math.random() * templates.length)];
|
| 141 |
}
|
| 142 |
|
| 143 |
+
function getOperationSymbol(operation) {
|
| 144 |
+
const symbols = { addition: '+', subtraction: '-', multiplication: '×', division: '÷' };
|
| 145 |
+
return symbols[operation] || '?';
|
|
|
|
|
|
|
|
|
|
|
|
|
| 146 |
}
|
| 147 |
|
| 148 |
+
function getOperationWord(operation) {
|
| 149 |
+
const words = { addition: 'plus', subtraction: 'minus', multiplication: 'times', division: 'divided by' };
|
| 150 |
+
return words[operation] || 'operated with';
|
| 151 |
}
|
| 152 |
|
| 153 |
+
function generateKnowledgeResponse(topic) {
|
| 154 |
+
const baseContent = knowledgeBase[topic] || knowledgeBase.ai;
|
| 155 |
+
const sentences = baseContent.split('. ');
|
| 156 |
+
|
| 157 |
+
const selectedSentences = [];
|
| 158 |
+
const usedIndices = new Set();
|
| 159 |
+
|
| 160 |
+
while (selectedSentences.length < 3 && usedIndices.size < sentences.length) {
|
| 161 |
+
const randomIndex = Math.floor(Math.random() * sentences.length);
|
| 162 |
+
if (!usedIndices.has(randomIndex)) {
|
| 163 |
+
selectedSentences.push(sentences[randomIndex]);
|
| 164 |
+
usedIndices.add(randomIndex);
|
|
|
|
| 165 |
}
|
| 166 |
}
|
| 167 |
|
| 168 |
+
const dynamicContent = selectedSentences.join('. ') + '.';
|
| 169 |
+
const style = responseStyles[Math.floor(Math.random() * responseStyles.length)];
|
| 170 |
+
|
| 171 |
+
return style(dynamicContent);
|
| 172 |
}
|
| 173 |
|
| 174 |
+
function generateEmotionalResponse(text) {
|
| 175 |
+
const lowerText = text.toLowerCase();
|
| 176 |
+
let emotionType = 'general';
|
| 177 |
+
|
| 178 |
+
if (lowerText.includes('sad') || lowerText.includes('depressed')) emotionType = 'sad';
|
| 179 |
+
else if (lowerText.includes('stress') || lowerText.includes('anxious') || lowerText.includes('worried')) emotionType = 'stressed';
|
| 180 |
+
else if (lowerText.includes('tired') || lowerText.includes('exhausted')) emotionType = 'tired';
|
| 181 |
+
|
| 182 |
+
const responses = emotionalSupport[emotionType];
|
| 183 |
+
return responses[Math.floor(Math.random() * responses.length)];
|
| 184 |
}
|
| 185 |
|
| 186 |
+
function generateGreeting() {
|
| 187 |
+
const greetings = [
|
| 188 |
+
"Hello! It's wonderful to connect with you today. How can I assist with your inquiries?",
|
| 189 |
+
"Greetings! I'm here to provide insights and support for whatever questions you might have.",
|
| 190 |
+
"Hi there! Ready to explore some interesting topics together?",
|
| 191 |
+
"Hello! I'm looking forward to our conversation and the knowledge we'll exchange.",
|
| 192 |
+
"Warm greetings! I'm prepared to assist with information, analysis, or just thoughtful conversation."
|
| 193 |
+
];
|
| 194 |
+
return greetings[Math.floor(Math.random() * greetings.length)];
|
| 195 |
+
}
|
| 196 |
+
|
| 197 |
+
function generateIdentityResponse() {
|
| 198 |
+
const identities = [
|
| 199 |
+
"I'm ZetaHack, an advanced reasoning system designed to provide insightful analysis and meaningful conversation across diverse domains.",
|
| 200 |
+
"I'm ZetaHack, your intelligent companion for exploring complex topics, solving problems, and engaging in thoughtful dialogue.",
|
| 201 |
+
"I'm ZetaHack, a sophisticated AI system created to assist with knowledge, reasoning, and understanding across multiple disciplines.",
|
| 202 |
+
"I'm ZetaHack, built to process information, generate insights, and communicate effectively about technology, science, mathematics, and human experience."
|
| 203 |
+
];
|
| 204 |
+
return identities[Math.floor(Math.random() * identities.length)];
|
| 205 |
+
}
|
| 206 |
+
|
| 207 |
+
const intent = detectIntent(input);
|
| 208 |
|
| 209 |
+
switch (intent) {
|
| 210 |
+
case 'math_calculation':
|
| 211 |
+
const mathResult = performMathCalculation(input);
|
| 212 |
+
if (mathResult) {
|
| 213 |
+
return generateMathResponse(mathResult);
|
| 214 |
+
}
|
| 215 |
+
return generateKnowledgeResponse('math');
|
| 216 |
+
|
| 217 |
+
case 'emotional_support':
|
| 218 |
+
return generateEmotionalResponse(input);
|
| 219 |
+
|
| 220 |
+
case 'greeting':
|
| 221 |
+
return generateGreeting();
|
| 222 |
+
|
| 223 |
+
case 'identity':
|
| 224 |
+
return generateIdentityResponse();
|
| 225 |
+
|
| 226 |
+
case 'ai':
|
| 227 |
+
case 'math':
|
| 228 |
+
case 'philosophy':
|
| 229 |
+
return generateKnowledgeResponse(intent);
|
| 230 |
+
|
| 231 |
+
default:
|
| 232 |
+
const fallbackTopics = ['ai', 'math', 'philosophy'];
|
| 233 |
+
const randomTopic = fallbackTopics[Math.floor(Math.random() * fallbackTopics.length)];
|
| 234 |
+
return generateKnowledgeResponse(randomTopic);
|
| 235 |
+
}
|
| 236 |
}
|