Method IsSarcastic
- Namespace
- LMKit.TextAnalysis
- Assembly
- LM-Kit.NET.dll
IsSarcastic(string, CancellationToken)
Analyzes the provided text to determine if it contains sarcasm.
public bool IsSarcastic(string text, CancellationToken cancellationToken = default)
Parameters
textstringThe text to analyze for sarcastic content.
cancellationTokenCancellationTokenOptional. A CancellationToken for handling cancellation requests.
Returns
- bool
trueif the text is identified as sarcastic; otherwise,false.
Examples
// Analyze text for sarcasm
bool isSarcastic = sarcasmDetector.IsSarcastic("Yeah, because I have nothing better to do.");
Console.WriteLine($"Is sarcastic: {isSarcastic}");
Remarks
This method performs a synchronous analysis of the text. For large texts or when running in UI applications, consider using the asynchronous version IsSarcasticAsync(string, CancellationToken).
Exceptions
- ArgumentNullException
Thrown if the input
textisnullor whitespace.