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:

Use this page when you want to test:

Main page link:
๐Ÿ”ง Open ACE Stem Tester (ace_stem_tester.php)

1. Purpose of the ACE Stem Tester

The Stem Tester is designed to answer questions like:

It is completely driven by a single core function:

build_combined_token($F, $r0, $r1, $r2, $pronIdx, $infl1, $infl2, $tense)

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:

Example setting:
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:

  1. Read input from $_GET or $_POST:
    root (r0,r1,r2), form, tense, infl1, infl2, pronoun index, declension, particle group, etc.
  2. 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
  3. Loop over pronouns:
    • If pronoun = 0 โ†’ loop from 1 to 14
    • Else โ†’ use fixed pronoun index
  4. 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).
  5. Add subject prefixes/suffixes:
    • Perfect tense: append suffix from $perfectSuffixes
    • Imperfect tense: add prefix from $imperfectPrefixes and suffix from $imperfectSuffixes
  6. 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)
  7. Convert Latin โ†’ Arabic:
    • Using latinToArabic()
    • Inserting sukun between two consonants
    • Inserting shaddah for doubled radicals
    • Applying Tajweed colors (Tafkhฤซm, Qalqalah, throat letters)
  8. Generate IPA using Latin-to-IPA mapping.
  9. Generate translation using getTenseTranslation(), based on:
    • Tense (1โ€“44)
    • Voice (active/passive)
    • Pronoun index
    • Form (Iโ€“X)
  10. Optional: Frequency:
    • If DB is connected, call getQuranMatchCount($latinWord)
    • Display N/A if DB is not available.
For ktb, Form 1, Tense 2, Pronoun โ€œheโ€:
โ†’ 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:

The mapping from (form, tense, root type, etc.) โ†’ F is handled in the Stem Tester logic + auxiliary utility functions. You normally do not need to set F manually; it is derived automatically.
5. Interpreting the Output Table

The result table has the following columns:

Row example:
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:

6. Vowels, Weak Verbs & Special Cases

The Stem Tester is especially useful for testing weak patterns:

By changing V1 / V2 and the pronoun, you can see how ACE reshapes the internal vowels.

Try:
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:

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.

Example:
Tense = 14 (Prohibitive), Form 1, Root ktb, Pronoun โ€œyou (m. sg.)โ€
โ†’ ู„ุง ุชูƒุชุจ โ€” โ€œdo not write!โ€
8. Practical Tips & Debugging
Recommended first test:
Root = ktb, Form = 1, Tense = 2, Pronoun = 0, V1 = a, V2 = u
โ†’ This should give the familiar full table: ูŠูƒุชุจ, ุชูƒุชุจ, ูŠูƒุชุจูˆู†, ูŠูƒุชุจู†, ุฃูƒุชุจ, ู†ูƒุชุจ, etc.

Next Documentation Pages