Class LinguisticsUtils
java.lang.Object
org.episteme.social.linguistics.LinguisticsUtils
Utility class providing mathematical models used in linguistics,
such as Zipf's law for word frequency distribution.
- Since:
- 2.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublecalculateZipf(double k, double s, double n) Calculates Zipf's law probability.
-
Method Details
-
calculateZipf
public static double calculateZipf(double k, double s, double n) Calculates Zipf's law probability. P(k) = 1 / (k^s * H(n, s)) where H is the generalized harmonic number.- Parameters:
k- rank of the words- value of the exponent characterizing the distributionn- total number of elements- Returns:
- the probability of the k-th element
- See Also:
-