Smart Adverb Generation in Softanza
Converting words to adverbs isn't straightforward. Consider these examples:
par Mansour Ayouni · dans le dépôt depuis le 2025-06-13 · essai de fonction · domaine Agents et conversation
Cet article est écrit en anglais, comme la bibliothèque.
The Softanza library introduces an intelligent Adverb() function that transforms adjectives and nouns into contextually appropriate adverbs using a priority-based rule system. Unlike simple suffix concatenation, this feature handles linguistic irregularities, domain-specific terminology, and morphological patterns systematically.
The Challenge
"good" + "ly" = "goodly" ❌ # Should be "well" "happy" + "ly" = "happyly" ❌ # Should be "happily" "finance" + "ly" = "financely" ❌ # Should be "financially"
illustration
English morphology requires context-aware transformations, not mechanical suffix addition.
How It Works
The system uses prioritized pattern matching:
1. Irregular Forms (Priority 1)
Handles words with unique adverb forms:
? Adverb("good") #--> "well"
? Adverb("fast") #--> "fast"
? Adverb("hard") #--> "hard"exécuté le 2026-10-08 20:41 au commit 4a184e6f0 : a tenu sa promesse
2. Preserve Existing Adverbs (Priority 2)
Prevents double transformation:
? Adverb("quickly") #--> "quickly" (not "quicklyly")
? Adverb("backward") #--> "backward"
? Adverb("likewise") #--> "likewise"illustration
3. Domain-Specific Patterns (Priority 3)
Provides professional context:
? Adverb("finance") #--> "financially"
? Adverb("technology") #--> "technologically"
? Adverb("sales") #--> "sales-wise"
? Adverb("marketing") #--> "from a marketing perspective"
? Adverb("education") #--> "educationally"exécuté le 2026-10-08 20:41 au commit 4a184e6f0 : a tenu sa promesse
4. Language/Geographic Context (Priority 4)
Handles cultural references:
? Adverb("english") #--> "in English"
? Adverb("french") #--> "in French"
? Adverb("american") #--> "in an American way"illustration
5. Morphological Patterns (Priority 5)
Applies standard English transformations:
? Adverb("happy") #--> "happily" (y → ily)
? Adverb("gentle") #--> "gently" (le → ly)
? Adverb("basic") #--> "basically" (ic → ically)
? Adverb("comfortable") #--> "comfortably" (able → ably)
? Adverb("creative") #--> "creatively" (ive → ively)illustration
Pattern Flexibility
Domain patterns use regex matching for word families:
# Pattern: "(technolog).*" matches:
? Adverb("technology") #--> "technologically"
? Adverb("technological") #--> "technologically"
? Adverb("technologist") #--> "technologically"exécuté le 2026-10-08 20:41 au commit 4a184e6f0 : a tenu sa promesse
This covers variations without explicit enumeration.
Implementation Benefits
Systematic Coverage: 25 rules handle thousands of cases through pattern matching rather than exhaustive word lists.
Maintainable: Adding new domains requires single regex patterns:
AddAdverbRule("(legal|law).*", "legally", "regex", 3, "domain")illustration
Predictable: Priority system ensures consistent behavior. Higher priority rules override lower ones.
Extensible: Categories enable targeted rule management:
? GetRulesByCategory("domain") # Returns all business/technical rules
? GetRulesByCategory("morphology") # Returns suffix transformation rulesillustration
Real-World Applications
Text Processing: Convert adjective-heavy content to adverb-rich prose for stylistic variation.
Natural Language Generation: Ensure grammatically correct adverb forms in automated writing.
Educational Tools: Demonstrate English morphological patterns programmatically.
Business Communication: Generate contextually appropriate professional terminology.
Edge Case Handling
The system gracefully handles various inputs:
? Adverb("QUICK") #--> "quickly" (case normalization)
? Adverb(" slow ") #--> "slowly" (whitespace trimming)
? Adverb("xyzabc") #--> "xyzabcly" (unknown words get default)illustration
Adding Custom Rules
Extend functionality for specific domains:
# Add legal terminology
AddAdverbRule("^legal$", "legally", "exact", 2, "domain")
AddAdverbRule("(contract).*", "contractually", "regex", 3, "domain")
# Add morphological pattern
AddAdverbRule("(.+)ment$", "\\1mentally", "regex", 5, "morphology")illustration
The Softanza Adverb() function demonstrates how linguistic complexity can be managed through systematic pattern recognition, delivering both accuracy and maintainability in natural language processing tasks.
Citer
Mansour Ayouni. « Smart Adverb Generation in Softanza ». Softanza narrations, 2025. https://mayouni.github.io/stzsite/fr/narrations/stz-max-adverb-generation-in-softan.html
Exécuté au nom de Haro le 2026-10-08 20:41 dans la bibliothèque au commit 4a184e6f0, bloc après bloc dans un seul processus : 3 bloc(s) sur 11 ont tenu leur promesse ; les autres sont des illustrations. Le code des articles est du code Haro. Là où un article a été écrit avant que la langue prenne son nom actuel, le nom a été changé et rien d'autre. Genre, domaine et série lus dans le nom du fichier, année tirée du premier commit : dérivés, jusqu'à ce que l'article porte son propre en-tête. Le fichier sur GitHub(s'ouvre dans un nouvel onglet)

