Skip to content

Commit 13fc357

Browse files
Update soap.h
1 parent c3ee77a commit 13fc357

File tree

1 file changed

+44
-54
lines changed

1 file changed

+44
-54
lines changed

code/logic/fossil/io/soap.h

Lines changed: 44 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -75,102 +75,92 @@ int fossil_io_soap_check_grammar(const char *text);
7575
char *fossil_io_soap_normalize(const char *text);
7676

7777
/**
78-
* @brief Generate a hashed audit trail of all detected issues in input.
78+
* @brief Analyze the sentiment of the input text.
7979
*
80-
* @param text Input string to audit.
81-
* @return A JSON-formatted string with all flags and replacements, signed (caller must free).
80+
* @param text The input string.
81+
* @return A string like "positive", "negative", or "neutral".
8282
*/
83-
char *fossil_io_soap_generate_audit_block(const char *text);
83+
const char *fossil_io_soap_detect_sentiment(const char *text);
8484

8585
/**
86-
* @brief Return a digest summary of all transformations made to a string.
86+
* @brief Detect potential hate speech or harmful content.
8787
*
88-
* @param original Original input.
89-
* @param transformed Transformed result.
90-
* @return A cryptographic hash or short audit ID.
88+
* @param text The input string.
89+
* @return 1 if harmful content is detected, 0 otherwise.
9190
*/
92-
char *fossil_io_soap_diff_digest(const char *original, const char *transformed);
91+
int fossil_io_soap_detect_harmful_content(const char *text);
9392

9493
/**
95-
* @brief Generate a hashed audit trail of all detected issues in input.
94+
* @brief Normalize internet slang or leetspeak in input text.
9695
*
97-
* @param text Input string to audit.
98-
* @return A JSON-formatted string with all flags and replacements, signed (caller must free).
96+
* @param text The input string.
97+
* @return A dynamically allocated cleaned-up version (must be freed).
9998
*/
100-
char *fossil_io_soap_generate_audit_block(const char *text);
99+
char *fossil_io_soap_normalize_slang(const char *text);
101100

102101
/**
103-
* @brief Return a digest summary of all transformations made to a string.
102+
* @brief Apply a grammar correction pass over the input text.
104103
*
105-
* @param original Original input.
106-
* @param transformed Transformed result.
107-
* @return A cryptographic hash or short audit ID.
108-
*/
109-
char *fossil_io_soap_diff_digest(const char *original, const char *transformed);
110-
111-
/**
112-
* @brief Detect sarcasm, satire, or irony in a phrase.
113-
*
114-
* @param text Input string.
115-
* @return 1 if detected, 0 if not.
104+
* @param text The input text.
105+
* @return A dynamically allocated corrected string (must be freed).
116106
*/
117-
int fossil_io_soap_detect_sarcasm(const char *text);
107+
char *fossil_io_soap_correct_grammar(const char *text);
118108

119109
/**
120-
* @brief Determine if the tone of the input is informative, persuasive, emotional, etc.
110+
* @brief Evaluate the clarity and readability level of the input text.
121111
*
122-
* @param text Input text.
123-
* @return A short string such as "informative", "emotional", "neutral".
112+
* @param text The input string.
113+
* @return Readability score (e.g., Flesch-Kincaid grade level).
124114
*/
125-
const char *fossil_io_soap_detect_intent(const char *text);
115+
float fossil_io_soap_evaluate_readability(const char *text);
126116

127117
/**
128-
* @brief Flag potentially offensive, biased, or manipulative phrases.
118+
* @brief Detect exaggeration or hyperbolic language in a sentence.
129119
*
130-
* @param text Input string.
131-
* @return A sanitized copy of the input with flagged content marked (caller must free).
120+
* @param text The input string.
121+
* @return 1 if exaggeration detected, 0 otherwise.
132122
*/
133-
char *fossil_io_soap_flag_ethics(const char *text);
123+
int fossil_io_soap_detect_exaggeration(const char *text);
134124

135125
/**
136-
* @brief Return a list of ethical categories the input violates.
126+
* @brief Replace offensive language with neutral alternatives.
137127
*
138-
* @param text Input string.
139-
* @return JSON or CSV string of category names (caller must free).
128+
* @param text The input string.
129+
* @return A dynamically allocated sanitized string (must be freed).
140130
*/
141-
char *fossil_io_soap_list_ethics_flags(const char *text);
131+
char *fossil_io_soap_filter_offensive(const char *text);
142132

143133
/**
144-
* @brief Load SOAP behavior extensions from a `.fish` or `.jellyfish` mindset file.
134+
* @brief Check if input contains clickbait-style language.
145135
*
146-
* @param filename Path to file to load.
147-
* @return 0 on success, non-zero on error.
136+
* @param text The input string.
137+
* @return 1 if clickbait is detected, 0 otherwise.
148138
*/
149-
int fossil_io_soap_load_mindset_file(const char *filename);
139+
int fossil_io_soap_detect_clickbait(const char *text);
150140

151141
/**
152-
* @brief Serialize SOAP's current state into a `.jellyfish` compatible format.
142+
* @brief Detect logical fallacies or flawed reasoning in a sentence.
153143
*
154-
* @return A `.jellyfish` format string with active filters, models, and thresholds (caller must free).
144+
* @param text The input string.
145+
* @return A string describing the detected fallacy, or NULL if none found.
155146
*/
156-
char *fossil_io_soap_export_mindset(void);
147+
const char *fossil_io_soap_detect_fallacy(const char *text);
157148

158149
/**
159-
* @brief Score the semantic similarity between two phrases.
150+
* @brief Summarize the key idea in the input sentence.
160151
*
161-
* @param a First input.
162-
* @param b Second input.
163-
* @return A similarity score from 0.0 to 1.0.
152+
* @param text The input string.
153+
* @return A dynamically allocated short summary (must be freed).
164154
*/
165-
float fossil_io_soap_semantic_similarity(const char *a, const char *b);
155+
char *fossil_io_soap_summarize(const char *text);
166156

167157
/**
168-
* @brief Determine if the given input matches a known propaganda or meme pattern.
158+
* @brief Score how polite or impolite the tone of the input is.
169159
*
170-
* @param text Input to check.
171-
* @return 1 if matched, 0 otherwise.
160+
* @param text The input string.
161+
* @return A score from 0.0 (rude) to 1.0 (very polite).
172162
*/
173-
int fossil_io_soap_detect_memetic_pattern(const char *text);
163+
float fossil_io_soap_politeness_score(const char *text);
174164

175165
#ifdef __cplusplus
176166
}

0 commit comments

Comments
 (0)