Skip to content

Commit d92fcaa

Browse files
committed
missing Javadoc (CR Tais)
1 parent 036060c commit d92fcaa

File tree

1 file changed

+18
-1
lines changed
  • application/src/main/java/org/togetherjava/tjbot/commands/moderation/scam

1 file changed

+18
-1
lines changed

application/src/main/java/org/togetherjava/tjbot/commands/moderation/scam/ScamDetector.java

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,31 @@
88
import java.net.URI;
99
import java.util.regex.Pattern;
1010

11-
public class ScamDetector {
11+
/**
12+
* Detects whether a text message classifies as scam or not, using certain heuristics.
13+
*
14+
* Highly configurable, using {@link ScamBlockerConfig}. Main method to use is
15+
* {@link #isScam(CharSequence)}.
16+
*/
17+
public final class ScamDetector {
1218
private static final Pattern TOKENIZER = Pattern.compile("[\\s,]");
1319
private final ScamBlockerConfig config;
1420

21+
/**
22+
* Creates a new instance with the given configuration
23+
*
24+
* @param config the scam blocker config to use
25+
*/
1526
public ScamDetector(@NotNull Config config) {
1627
this.config = config.getScamBlocker();
1728
}
1829

30+
/**
31+
* Detects whether the given message classifies as scam or not, using certain heuristics.
32+
*
33+
* @param message the message to analyze
34+
* @return Whether the message classifies as scam
35+
*/
1936
public boolean isScam(@NotNull CharSequence message) {
2037
AnalyseResults results = new AnalyseResults();
2138
TOKENIZER.splitAsStream(message).forEach(token -> analyzeToken(token, results));

0 commit comments

Comments
 (0)