Class Ari

java.lang.Object
org.ek9lang.core.Ari

public class Ari extends Object
Automated Readability Index (ARI) adapted for source code. Returns a numeric score where lower values indicate simpler lexical structure.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Maximum ARI score (capped for practical display purposes).
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ari()
     
  • Method Summary

    Modifier and Type
    Method
    Description
    getScore(int numberOfLetters, int numberOfWords, int numberOfIndents, int numberOfNewLines)
    Get readability score as a simple numeric value.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • MAX_SCORE

      public static final int MAX_SCORE
      Maximum ARI score (capped for practical display purposes). Higher scores indicate more complex lexical structure.
      See Also:
  • Constructor Details

    • Ari

      public Ari()
  • Method Details

    • getScore

      public String getScore(int numberOfLetters, int numberOfWords, int numberOfIndents, int numberOfNewLines)
      Get readability score as a simple numeric value.

      Returns an integer score where lower = simpler lexical structure. For source code, this measures word/identifier length and statement density, not conceptual complexity. Score range is 1-20 (capped at 20).

      Modified for source code: standard ARI uses ~5 char average word length, but source code identifiers average 10-15 chars (camelCase, descriptive names). We normalize by dividing the character/word ratio by 2.0 to account for this.