Skip to main content

character_traits_curiosity_and_knowledge_seeking/
classify.rs

1// ---------------- [ File: character-traits-curiosity-and-knowledge-seeking/src/classify.rs ]
2crate::ix!();
3
4pub fn tokenise_pascal_case(name: &str) -> Vec<String> {
5    let mut out = Vec::<String>::new();
6    let mut cur = String::new();
7    for ch in name.chars() {
8        if ch.is_ascii_uppercase() && !cur.is_empty() {
9            out.push(cur.clone());
10            cur.clear();
11        }
12        cur.push(ch);
13    }
14    if !cur.is_empty() {
15        out.push(cur);
16    }
17    out
18}
19
20pub fn classify_modifier(tok: &str) -> Option<CuriosityModifier> {
21    use CuriosityModifier::*;
22    Some(match tok {
23        "Actively" | "Active"           => Active,
24        "Adventurous"                   => Adventurous,
25        "Always"                        => Always,
26        "Committed"                     => Committed,
27        "Constantly" | "Constant"       => Constant,
28        "Continuously" | "Continuous"   => Continuous,
29        "Deeply"                        => Deeply,
30        "Driven"                        => Driven,
31        "Highly"                        => Highly,
32        "Intensely"                     => Intensely,
33        "Passionate"                    => Passionate,
34        "Reflective"                    => Reflective,
35        "Skeptically" | "Skeptical"     => Skeptical,
36        "Systematic" | "Systematically" => Systematic,
37        "Values" | "Valued"             => Values,
38        "God" | "GodOf"                 => Godly,
39        _ => return None,
40    })
41}
42
43pub fn classify_behaviour(tok: &str) -> Option<CuriosityBehaviour> {
44    use CuriosityBehaviour::*;
45    Some(match tok {
46        "Engages" | "Engage"                                                                       => Engage,
47        "Explores" | "Explore"                                                                     => Explore,
48        "Seeks" | "Seek" | "Seeking" | "Inquisitive" | "Inquisitiveness" | "Curiosity" | "Curious" => Seek,
49        "Pursues" | "Pursue" | "Pursuit"                                                           => Pursue,
50        "Promotes" | "Promote"                                                                     => Promote,
51        "Provides" | "Provide"                                                                     => Provide,
52        "Documents" | "Document"                                                                   => Document,
53        "Embraces" | "Embrace"                                                                     => Embrace,
54        "Observant" | "Observing" | "Observes" | "Observe"                                         => Observe,
55        "Discovers" | "Discover"                                                                   => Discover,
56        "Values" | "Valuing"                                                                       => Value,
57        "Teaches" | "Teach"                                                                        => Teach,
58        "Understands" | "Understand"                                                               => Understand,
59        _                                                                                          => return None,
60    })
61}
62
63pub fn classify_domain(phrase: &str) -> Option<CuriosityDomain> {
64    use CuriosityDomain::*;
65    Some(match phrase {
66        "IntellectualExploration" => IntellectualExploration,
67        "CulturalAndSocialUnderstanding" => CulturalAndSocialUnderstanding,
68        "ScienceAndPhilosophy" => ScienceAndPhilosophy,
69        "StrategicInsightsFromHistory" => StrategicHistory,
70        "PursuitOfKnowledge"
71        | "InPursuitOfKnowledge"
72        | "Knowledge"
73        | "Curiosity"
74        | "Curious" => BroadKnowledge,
75        "ContinualLearningAndExploration"
76        | "ContinuousLearningAndDiscovery"
77        | "AlwaysSeekingKnowledge" => BroadKnowledge,
78        "ContinualMoralAndSpiritualGrowth" => MoralAndSpiritualGrowth,
79        "LegalAndPoliticalInnovation" => LegalAndPoliticalInnovation,
80        "HumanNature" | "UnderstandingHumanNature" => HumanNature,
81        /* exhaustive mapping continues … */
82        _ => return None,
83    })
84}