ACE Stem Tester โ Documentation
The ACE Stem Tester is your main laboratory for experimenting with roots, forms, tenses, vowels, pronouns, articles, particles and declensions. It shows exactly how ACE builds:
- Latin stems (prefix + stem + suffix)
- Arabic output with Tajweed coloring
- IPA transcription
- Contextual English translations (and Urdu if enabled)
Use this page when you want to test:
- โ A specific root (e.g.
ktb) in a specific form - โ One tense (e.g. Active Imperfect 2) or all tenses
- โ All 14 subject pronouns for a root
- โ Vowel variants (V1/V2) and weak/hollow/defective verbs
- โ Particles such as
lan,lam,laA, etc.
๐ง Open ACE Stem Tester (ace_stem_tester.php)
1. Purpose of the ACE Stem Tester
The Stem Tester is designed to answer questions like:
- What does Form II of root
ktblook like in tense 2? - How does the pattern change when I choose V1 =
a, V2 =i? - How do hollow or defective verbs behave for different pronouns?
- What happens when I attach an object pronoun or genitive pronoun?
It is completely driven by a single core function:
The Stem Tester provides the UI and glue logic around this function:
it gathers parameters from the form, loops over pronouns/declensions,
calls build_combined_token(), and then converts the result to Arabic, IPA, and translations.
2. User Inputs & Controls
The top panel of ace_stem_tester.php contains the main controls:
- Root (r0, r1, r2) โ selected from dropdown (e.g. k, t, b)
- Form โ 1โ10 (IโX)
- Tense (1โ44) โ classifications as in docs_tenses.php
- V1 (infl1) โ usually the โperfectโ internal vowel (a / i / u)
- V2 (infl2) โ usually the โimperfectโ internal vowel (a / i / u / uw / iy โฆ)
- Conjunction โ e.g.
wa,fa, etc. (or none) - Definite Article โ
alor none - Subject pronoun:
0= all 14 pronouns (full conjugation table)- 1โ14 = a specific pronoun only
- Attached pronoun (object) โ e.g.
hu,ka, etc. - Genitive pronoun โ used with noun patterns (15โ23)
- Declension suffix โ for nominal tenses (15โ23)
- Particle group (24โ44) and member โ e.g.
lan,lam,laA, etc. - Assembly mode โ Automatic or Manual
- Show spaces โ whether to display spaces between conjunction / particles and the verb
- Language โ English (Urdu handled in the translation engine if enabled)
Root = ktb, Form = 1, Tense = 2 (Active Imperfect), V1 = a, V2 = u, Pronoun = 0 (all)
โ Shows full table for ููุชุจ in all 14 pronouns.
3. Internal Flow When You Click โAnalyzeโ
When you click Analyze, the Stem Tester runs roughly the following steps:
- Read input from
$_GETor$_POST:
root (r0,r1,r2), form, tense, infl1, infl2, pronoun index, declension, particle group, etc. - Determine the pattern code
$F:"1-1"= Form I perfect active"1-2"= Form I imperfect active (yaktubu pattern)"2-7"= Form II passive perfect"8-1"= Form VIII perfect (with assimilation rules)"hol11"/"def22"/"dup1"etc. = special hollow / defective / doubled patterns
- Loop over pronouns:
- If pronoun = 0 โ loop from 1 to 14
- Else โ use fixed pronoun index
- Call
build_combined_token()for each row:list($latinBase, $ipref, $fform, $v1, $v2, $double) = build_combined_token($F, $r0, $r1, $r2, $pronIdx, $infl1, $infl2, $tense);This returns the base form (without subject affixes). - Add subject prefixes/suffixes:
- Perfect tense: append suffix from
$perfectSuffixes - Imperfect tense: add prefix from
$imperfectPrefixesand suffix from$imperfectSuffixes
- Perfect tense: append suffix from
- Merge conjunction / particle / article / pronouns:
- Optionally prepend
wa,fa, etc. - Optionally prepend
al(definite article) - Append object pronoun (e.g.
hu) - Append genitive pronoun for nouns (e.g.
hi)
- Optionally prepend
- Convert Latin โ Arabic:
- Using
latinToArabic() - Inserting sukun between two consonants
- Inserting shaddah for doubled radicals
- Applying Tajweed colors (Tafkhฤซm, Qalqalah, throat letters)
- Using
- Generate IPA using Latin-to-IPA mapping.
- Generate translation using
getTenseTranslation(), based on:- Tense (1โ44)
- Voice (active/passive)
- Pronoun index
- Form (IโX)
- Optional: Frequency:
- If DB is connected, call
getQuranMatchCount($latinWord) - Display N/A if DB is not available.
- If DB is connected, call
โ F = "1-2"
โ build_combined_token() returns base "a" + "ktub"
โ Prefix = "ya", suffix = "u"
โ Latin: yaktubu
โ Arabic: ููููุชูุจู
โ Meaning: โhe does write / he is writingโ.
4. Pattern Codes (F) Used by build_combined_token()
The Stem Tester doesnโt hard-code the full stem internally.
Instead, it chooses a pattern code $F, which tells build_combined_token()
which branch of the big switch to use.
Common categories:
- "1-1" ... "10-1" โ Perfect (past) active
- "1-7" ... "10-7" โ Perfect (past) passive
- "1-2" ... "10-6" โ Imperfect active
- "1-8" ... "10-12" โ Imperfect passive-like variants
- "1-13" ... "10-13" โ Imperatives and special derived patterns
- "1-14" ... "10-14" โ Prohibitives (laA + imperfect)
- "1-15" ... "10-15" โ Active participle
- "1-16" ... "10-16" โ Passive participle
- "1-17" ... "10-17" โ Verbal noun (maแนฃdar)
- "18-*", "19-*", "20-*", "21-*", "22-*", "23-*" โ derived nouns, adjectives, broken plurals
- "mth**" โ mithฤl (initial weak) verbs
- "hol**" โ hollow verbs
- "def**" โ defective verbs
- "dup**" โ doubled middle radical
- "hmz**" โ hamzated roots
5. Interpreting the Output Table
The result table has the following columns:
- # โ Row index (form-tense-pronoun combination)
- Arabic (colored) โ Prefixed + suffixed, colored per Tajweed rules
- Latin (link + freq) โ Latin token + optional frequency link
- IPA โ Pronunciation
- Translation โ English gloss (and Urdu if enabled)
1-2-1 | ููููุชูุจู | yaktubu (N/A) | ya.ktu.bu | he does write โ Active Imperfect Verb
The code such as 1-2-1 can be read as:
- Form: 1 (I)
- Tense: 2 (Active Imperfect)
- Pronoun index: 1 (he)
6. Vowels, Weak Verbs & Special Cases
The Stem Tester is especially useful for testing weak patterns:
- Mithฤl (initial weak) โ mth** patterns
- Hollow verbs โ hol** patterns
- Defective (final weak) โ def** patterns
- Doubled radicals โ dup** patterns
- Hamzated verbs โ hmz** patterns
By changing V1 / V2 and the pronoun, you can see how ACE reshapes the internal vowels.
Root = qwl, Form = 1, Tense = 1 (past), V1 = a, V2 = u
Compare pronoun 1 (he) vs pronoun 7 (you masc. sg.) to see hollow transformations.
7. Particles, Prohibitives (14), and Emphatics
The Stem Tester also demonstrates tense categories like:
- Subjunctive (lan + imperfect)
- Jussive (lam + imperfect)
- Light / Heavy Emphatic (related to โlaโ + verb)
- Prohibitive (tense 14, laA + imperfect)
For prohibitive (14), ACE uses dedicated F-codes such as 1-14, 2-14, etc.,
and for Form VIII, special cases are handled in 8-14 with assimilation.
Tense = 14 (Prohibitive), Form 1, Root ktb, Pronoun โyou (m. sg.)โ
โ ูุง ุชูุชุจ โ โdo not write!โ
8. Practical Tips & Debugging
- Start with a strong verb such as
ktbto verify patterns. - Test first with V1 = a, V2 = u (standard faสฟala / yafaสฟulu).
- Set pronoun to 0 to see all 14 rows side by side.
- Use a known root + form + tense from the dictionary, then compare Stem Tester output.
- If Arabic or Latin look wrong, check:
- Did you choose the correct Form?
- Is the tense appropriate for that Form?
- Is the verb weak (hollow/defective)? If so, try different F-codes or V1/V2.
Root = ktb, Form = 1, Tense = 2, Pronoun = 0, V1 = a, V2 = u
โ This should give the familiar full table: ููุชุจ, ุชูุชุจ, ููุชุจูู, ููุชุจู, ุฃูุชุจ, ููุชุจ, etc.