Class Ari
java.lang.Object
org.ek9lang.core.Ari
Automated Readability Index (ARI) adapted for source code.
Returns a numeric score where lower values indicate simpler lexical structure.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intMaximum ARI score (capped for practical display purposes). -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
MAX_SCORE
public static final int MAX_SCOREMaximum 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.
-