Package org.sonarsource.analyzer.commons
Class HumanLanguageDetector
java.lang.Object
org.sonarsource.analyzer.commons.HumanLanguageDetector
-
Method Summary
Modifier and TypeMethodDescriptionstatic doublehumanLanguageScore(String text) Calculates human language score.
-
Method Details
-
humanLanguageScore
Calculates human language score. Before calling a method it is recommended to callStringUtils.stripAccents(text)to improve precision.- Parameters:
text- to analyze- Returns:
- 1.0 in average for random string, and above if it looks like language (ex: could be compared using > 1.5d)
-