v2026.6.4
All Bundles
Bundle Natural language processing toolkit. Provides tokenization, text preprocessing, TF-IDF vectorization, cosine similarity, and sentiment analysis. Works with plain strings — no external model required. Compile with -lib nlp.

SentimentResult

Sentiment analysis result

Example

result := System.NLP.SentimentAnalyzer->AnalyzeDetailed("Great product!");
score := result->GetScore();
label := result->GetClassification();

Operations

GetClassification #

Gets the classification label

method : public : GetClassification() ~ String

Return

TypeDescription
Stringclassification (positive, negative, or neutral)

Example

result := SentimentAnalyzer->AnalyzeDetailed("Awful product!");
result->GetClassification()->PrintLine();

GetScore #

Gets the sentiment score

method : public : GetScore() ~ Int

Return

TypeDescription
Intsentiment score

Example

result := SentimentAnalyzer->AnalyzeDetailed("Great job!");
"Score: {$result->GetScore()}"->PrintLine();

New # constructor

Constructor

New(score:Int, classification:String)

Parameters

NameTypeDescription
scoreIntsentiment score
classificationStringsentiment label

ToString #

String representation

method : public : ToString() ~ String

Return

TypeDescription
Stringformatted result