Softanza
StartFrançais
Softanza
Research · narration

From "Quick" to "Quickly": Programmatic Adverb Formation

by Mansour Ayouni · in the repository since 2025-09-16 · feature essay · area Agents & conversation

Softanza Adverb() function transforms (any) word into its proper adverbial form, handling English morphology complexities for programmers generating natural language messages. Softanza uses this function in its Explain() methods for data models and visualization, producing descriptions like "This data trends financially upward" or "Performance varies regionally" with domain-specific intelligence and extensible rules.

When "-ly" Isn't Enough

This seems straightforward:

Haro
? Adverb("quick")    #--> quickly
? Adverb("happy")    #--> happily  
? Adverb("gentle")   #--> gently

run on 2026-10-08 20:40 at commit 4a184e6f0: kept its promise

Add "-ly" and you're done, right? But then you encounter the rebels:

Haro
? Adverb("good")     #--> well
? Adverb("fast")     #--> fast
? Adverb("hard")     #--> hard

run on 2026-10-08 20:40 at commit 4a184e6f0: kept its promise

English refuses to cooperate. "Good" doesn't become "goodly"—it transforms into "well." Some words like "fast" stay unchanged. The simple suffix rule crumbles immediately.

Domain Contexts

Beyond basic morphology, Softanza recognizes that context shapes language. Business and technical domains have their own conventions:

Haro
? Adverb("finance")      #--> financially
? Adverb("science")      #--> scientifically
? Adverb("sales")        #--> sales-wise
? Adverb("accounting")   #--> from an accounting perspective
? Adverb("marketing")    #--> from a marketing perspective

run on 2026-10-08 20:40 at commit 4a184e6f0: kept its promise

Notice how "sales" becomes "sales-wise" rather than "salely"? Or how "accounting" and "marketing" get full prepositional phrases? This isn't arbitrary—it reflects how professionals actually speak in these fields.

Geographic Intelligence

The system understands cultural and geographic terms:

Haro
? Adverb("france")    #--> french
? Adverb("english")   #--> english
? Adverb("arab")      #--> arabic
? Adverb("africa")    #--> african
? Adverb("north")     #--> northern
? Adverb("west")      #--> western

run on 2026-10-08 20:40 at commit 4a184e6f0: kept its promise

When you say something is done "france," the system knows you mean in a "french" manner, not "francely."

Morphological Patterns

For regular transformations, Softanza handles the systematic patterns English actually follows:

Haro
? Adverb("basic")       #--> basically    (ic → ically)
? Adverb("comfortable") #--> comfortably  (able → ably)
? Adverb("play")        #--> playily      (vowel+y → ily)
? Adverb("dry")         #--> drily        (consonant+y → ily)

illustration

Each pattern captures a real morphological rule, with regex patterns that preserve word stems while transforming endings.

Five Priority Orders

Behind these examples lies a sophisticated priority system that processes adverb transformations through distinct levels:

  1. Priority 1: Irregulars - Fundamental exceptions that break all rules
  2. Priority 2: Preservation - Words already functioning as adverbs
  3. Priority 3: Domain Expertise - Context-aware, field-specific transformations
  4. Priority 4: Geographic & Cultural - Location and language patterns
  5. Priority 5: Morphological Patterns - Systematic suffix-based rules
  6. Priority 6: Fallback - Default "-ly" addition for unknown cases

The Priority System in Action

Watch how priorities resolve conflicts. Consider "business":

Haro
? Adverb("business")    #--> business-wise

run on 2026-10-08 20:40 at commit 4a184e6f0: kept its promise

Why not "businessly"? The system processes:

  1. Priority 1: Is "business" irregular? No.
  2. Priority 2: Already an adverb? No.
  3. Priority 3: Domain pattern match? Yes—apply "business-wise"

The search stops here. Domain-specific rules override morphological patterns.

Practical Limitations and Flexibility

This is a pragmatic tool designed primarily for Softanza's message generation needs. Consider these potential issues:

Haro
? Adverb("Education")   #--> educationly  (incorrect)
? Adverb("payment")     #--> paymentally  (after adding custom rule)

illustration

The system might produce awkward or incorrect results for edge cases or specialized terms outside its current rule coverage. As a programming tool focused on generating humanized messages, it can be valuable for programmers working on similar natural language generation tasks.

The Flexibility Solution

However, the system's strength lies in its adaptability. Programmers can address limitations through dynamic rule addition:

Haro
# Correcting problematic cases
AddAdverbRule("^education$", "educationally", "exact", 3, "domain")
? Adverb("education")   #--> educationally

# Adding domain-specific rules for your context  
AddAdverbRule("^legal$", "legally", "exact", 2, "domain")
? Adverb("legal")       #--> legally

run on 2026-10-08 20:40 at commit 4a184e6f0: kept its promise

Categories enable systematic management:

Haro
? len(GetAdverbRulesByCategory("domain"))      #--> 11
? len(GetAdverbRulesByCategory("morphology"))  #--> 12

illustration

Technical Foundation

Behind these examples lies the AdverbRules data structure:

Haro
[ "^good$", "well", "exact", 1, "irregular" ],
[ "(.+)ic$", "\\1ically", "regex", 5, "morphology" ],

illustration

The engine sorts by priority and applies matching strategies: exact matching, regex with capture groups, preservation rules, and fallback defaults.

Embracing Imperfection

Softanza's adverb function exemplifies pragmatic design: sophisticated enough to handle most cases correctly, flexible enough to adapt when it doesn't. Rather than pursuing impossible perfection, it provides tools for continuous improvement based on real-world usage and context-specific needs.

Cite

Mansour Ayouni. "From "Quick" to "Quickly": Programmatic Adverb Formation". Softanza narrations, 2025. https://mayouni.github.io/stzsite/en/narrations/stz-adverb-engine.html

Run in Haro's name on 2026-10-08 20:40 inside the library at commit 4a184e6f0, block after block in one process: 6 of 10 blocks kept their promise; the others are illustrations. The code of the articles is Haro code. Where an article was written before the language took its present name, the name was changed and nothing else. Genre, area and series read from the file's name, the year from its first commit: derived, until the article carries its own header. The file on GitHub(opens in a new tab)