@@ -215,62 +215,120 @@ FOSSIL_TEST(c_test_io_soap_suggest_with_tabs) {
215
215
free (result );
216
216
}
217
217
218
- FOSSIL_TEST (c_test_io_soap_detect_bias_political ) {
219
- const char * input = "All liberals are wrong." ;
220
- const char * expected = "political-bias" ;
221
- const char * result = fossil_io_soap_detect_bias (input );
222
- ASSUME_ITS_EQUAL_CSTR (expected , result );
218
+ FOSSIL_TEST (c_test_io_soap_check_grammar_valid ) {
219
+ const char * input = "She writes clearly and concisely." ;
220
+ ASSUME_ITS_TRUE (fossil_io_soap_check_grammar (input ) == 0 );
223
221
}
224
222
225
- FOSSIL_TEST (c_test_io_soap_detect_bias_noneutral ) {
226
- const char * input = "Dogs are better than cats." ;
227
- const char * expected = "subjective-bias" ;
228
- const char * result = fossil_io_soap_detect_bias (input );
229
- ASSUME_ITS_EQUAL_CSTR (expected , result );
223
+ FOSSIL_TEST (c_test_io_soap_check_grammar_error ) {
224
+ const char * input = "Him go store." ;
225
+ ASSUME_ITS_TRUE (fossil_io_soap_check_grammar (input ) != 0 );
230
226
}
231
227
232
- FOSSIL_TEST (c_test_io_soap_detect_fake_news_true_case ) {
233
- const char * input = "NASA confirms moon is made of cheese. " ;
234
- const char * expected = "fake " ;
235
- const char * result = fossil_io_soap_detect_fake_news (input );
228
+ FOSSIL_TEST (c_test_io_soap_normalize_informal ) {
229
+ const char * input = "u gotta see this " ;
230
+ const char * expected = "you have to see this " ;
231
+ char * result = fossil_io_soap_normalize (input );
236
232
ASSUME_ITS_EQUAL_CSTR (expected , result );
233
+ free (result );
234
+ }
235
+
236
+ FOSSIL_TEST (c_test_io_soap_detect_sentiment_positive ) {
237
+ const char * input = "I love working with you!" ;
238
+ const char * expected = "positive" ;
239
+ ASSUME_ITS_EQUAL_CSTR (expected , fossil_io_soap_detect_sentiment (input ));
240
+ }
241
+
242
+ FOSSIL_TEST (c_test_io_soap_detect_sentiment_negative ) {
243
+ const char * input = "This is the worst experience ever." ;
244
+ const char * expected = "negative" ;
245
+ ASSUME_ITS_EQUAL_CSTR (expected , fossil_io_soap_detect_sentiment (input ));
237
246
}
238
247
239
- FOSSIL_TEST (c_test_io_soap_detect_fake_news_valid_fact ) {
240
- const char * input = "The Earth revolves around the Sun." ;
241
- const char * expected = "valid" ;
242
- const char * result = fossil_io_soap_detect_fake_news (input );
248
+ FOSSIL_TEST (c_test_io_soap_detect_harmful_true ) {
249
+ const char * input = "People like you shouldn't exist." ;
250
+ ASSUME_ITS_TRUE (fossil_io_soap_detect_harmful_content (input ) == 1 );
251
+ }
252
+
253
+ FOSSIL_TEST (c_test_io_soap_detect_harmful_false ) {
254
+ const char * input = "I disagree with your opinion." ;
255
+ ASSUME_ITS_TRUE (fossil_io_soap_detect_harmful_content (input ) == 0 );
256
+ }
257
+
258
+ FOSSIL_TEST (c_test_io_soap_normalize_slang_basic ) {
259
+ const char * input = "idk why ppl do that lol" ;
260
+ const char * expected = "I don't know why people do that." ;
261
+ char * result = fossil_io_soap_normalize_slang (input );
243
262
ASSUME_ITS_EQUAL_CSTR (expected , result );
263
+ free (result );
244
264
}
245
265
246
- FOSSIL_TEST (c_test_io_soap_correct_grammar_typo ) {
247
- const char * input = "He go to school every day." ;
248
- const char * expected = "He goes to school every day." ;
266
+ FOSSIL_TEST (c_test_io_soap_correct_grammar_common ) {
267
+ const char * input = "He go to work every day." ;
268
+ const char * expected = "He goes to work every day." ;
249
269
char * result = fossil_io_soap_correct_grammar (input );
250
270
ASSUME_ITS_EQUAL_CSTR (expected , result );
251
271
free (result );
252
272
}
253
273
254
- FOSSIL_TEST (c_test_io_soap_correct_grammar_punctuation ) {
255
- const char * input = "hello how are you" ;
256
- const char * expected = "Hello, how are you?" ;
257
- char * result = fossil_io_soap_correct_grammar (input );
274
+ FOSSIL_TEST (c_test_io_soap_evaluate_readability_score ) {
275
+ const char * input = "The cat sat on the mat." ;
276
+ float score = fossil_io_soap_evaluate_readability (input );
277
+ ASSUME_ITS_TRUE (score > 0.0 );
278
+ }
279
+
280
+ FOSSIL_TEST (c_test_io_soap_detect_exaggeration_true ) {
281
+ const char * input = "This is the worst thing to ever happen in history!" ;
282
+ ASSUME_ITS_TRUE (fossil_io_soap_detect_exaggeration (input ) == 1 );
283
+ }
284
+
285
+ FOSSIL_TEST (c_test_io_soap_detect_exaggeration_false ) {
286
+ const char * input = "The weather is mildly unpleasant today." ;
287
+ ASSUME (fossil_io_soap_detect_exaggeration (input ) == 0 );
288
+ }
289
+
290
+ FOSSIL_TEST (c_test_io_soap_filter_offensive_basic ) {
291
+ const char * input = "You're an idiot." ;
292
+ const char * expected = "You're being unreasonable." ;
293
+ char * result = fossil_io_soap_filter_offensive (input );
258
294
ASSUME_ITS_EQUAL_CSTR (expected , result );
259
295
free (result );
260
296
}
261
297
262
- FOSSIL_TEST (c_test_io_soap_fuzzy_match_simple ) {
263
- const char * a = "rotbrain" ;
264
- const char * b = "rot-brain" ;
265
- bool result = fossil_io_soap_fuzzy_match (a , b );
266
- ASSUME_ITS_TRUE (result );
298
+ FOSSIL_TEST (c_test_io_soap_detect_clickbait_true ) {
299
+ const char * input = "You won't believe what happened next!" ;
300
+ ASSUME_ITS_TRUE (fossil_io_soap_detect_clickbait (input ) == 1 );
301
+ }
302
+
303
+ FOSSIL_TEST (c_test_io_soap_detect_clickbait_false ) {
304
+ const char * input = "Scientists publish new findings in journal." ;
305
+ ASSUME_ITS_TRUE (fossil_io_soap_detect_clickbait (input ) == 0 );
306
+ }
307
+
308
+ FOSSIL_TEST (c_test_io_soap_detect_fallacy_ad_hominem ) {
309
+ const char * input = "You can't trust his argument because he's ugly." ;
310
+ const char * expected = "ad hominem" ;
311
+ const char * result = fossil_io_soap_detect_fallacy (input );
312
+ ASSUME_ITS_EQUAL_CSTR (expected , result );
313
+ }
314
+
315
+ FOSSIL_TEST (c_test_io_soap_detect_fallacy_none ) {
316
+ const char * input = "We should implement this plan because it has proven benefits." ;
317
+ ASSUME_ITS_TRUE (fossil_io_soap_detect_fallacy (input ) == NULL );
318
+ }
319
+
320
+ FOSSIL_TEST (c_test_io_soap_summarize_simple ) {
321
+ const char * input = "The project aims to reduce emissions by introducing cleaner technologies and improving energy efficiency across sectors." ;
322
+ const char * expected = "Project reduces emissions." ;
323
+ char * result = fossil_io_soap_summarize (input );
324
+ ASSUME_ITS_EQUAL_CSTR (expected , result );
325
+ free (result );
267
326
}
268
327
269
- FOSSIL_TEST (c_test_io_soap_fuzzy_match_fail ) {
270
- const char * a = "hello" ;
271
- const char * b = "goodbye" ;
272
- bool result = fossil_io_soap_fuzzy_match (a , b );
273
- ASSUME_ITS_TRUE (!result );
328
+ FOSSIL_TEST (c_test_io_soap_politeness_score_range ) {
329
+ const char * input = "Could you please help me with this task?" ;
330
+ float score = fossil_io_soap_politeness_score (input );
331
+ ASSUME_ITS_TRUE (score >= 0.0f && score <= 1.0f );
274
332
}
275
333
276
334
// * * * * * * * * * * * * * * * * * * * * * * * *
@@ -300,14 +358,25 @@ FOSSIL_TEST_GROUP(c_soap_tests) {
300
358
FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_suggest_with_special_chars );
301
359
FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_suggest_with_newlines );
302
360
FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_suggest_with_tabs );
303
- FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_bias_political );
304
- FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_bias_noneutral );
305
- FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_fake_news_true_case );
306
- FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_fake_news_valid_fact );
307
- FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_correct_grammar_typo );
308
- FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_correct_grammar_punctuation );
309
- FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_fuzzy_match_simple );
310
- FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_fuzzy_match_fail );
361
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_check_grammar_valid );
362
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_check_grammar_error );
363
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_normalize_informal );
364
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_sentiment_positive );
365
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_sentiment_negative );
366
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_harmful_true );
367
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_harmful_false );
368
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_normalize_slang_basic );
369
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_correct_grammar_common );
370
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_evaluate_readability_score );
371
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_exaggeration_true );
372
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_exaggeration_false );
373
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_filter_offensive_basic );
374
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_clickbait_true );
375
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_clickbait_false );
376
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_fallacy_ad_hominem );
377
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_detect_fallacy_none );
378
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_summarize_simple );
379
+ FOSSIL_TEST_ADD (c_soap_suite , c_test_io_soap_politeness_score_range );
311
380
312
381
FOSSIL_TEST_REGISTER (c_soap_suite );
313
382
}
0 commit comments