Skip to content

Commit 419c63b

Browse files
revert
1 parent 6b54d2a commit 419c63b

File tree

4 files changed

+0
-281
lines changed

4 files changed

+0
-281
lines changed

code/logic/fossil/io/soap.h

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ int32_t fossil_soap_count_offensive(const char *input);
5454
*/
5555
int32_t fossil_soap_count_rotbrain(const char *input);
5656

57-
/**
58-
* Check if a string is context-aware.
59-
* Returns EXIT_FAILURE if the string is context-aware, EXIT_SUCCESS otherwise.
60-
*/
61-
int32_t fossil_soap_context_aware(const char *input);
62-
6357
#ifdef __cplusplus
6458
}
6559

@@ -120,14 +114,6 @@ namespace fossil {
120114
static int32_t count_rotbrain(const char *input) {
121115
return fossil_soap_count_rotbrain(input);
122116
}
123-
124-
/**
125-
* Check if a string is context-aware.
126-
* Returns EXIT_FAILURE if the string is context-aware, EXIT_SUCCESS otherwise.
127-
*/
128-
static int32_t context_aware(const char *input) {
129-
return fossil_soap_context_aware(input);
130-
}
131117
};
132118
}
133119
}

code/logic/soap.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -174,15 +174,3 @@ int32_t fossil_soap_count_offensive(const char *input) {
174174
int32_t fossil_soap_count_rotbrain(const char *input) {
175175
return count_matches(input, FOSSIL_SOAP_ROTBRAIN, sizeof(FOSSIL_SOAP_ROTBRAIN) / sizeof(*FOSSIL_SOAP_ROTBRAIN));
176176
}
177-
178-
int32_t fossil_soap_context_aware(const char *input) {
179-
int offensive_count = fossil_soap_count_offensive(input);
180-
int rotbrain_count = fossil_soap_count_rotbrain(input);
181-
182-
if (offensive_count > 0) {
183-
return 1; // Offensive content detected
184-
} else if (rotbrain_count > 0) {
185-
return 2; // Rotbrain content detected
186-
}
187-
return 0; // No offensive or rotbrain content detected
188-
}

code/tests/cases/test_soap.c

Lines changed: 0 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -151,100 +151,6 @@ FOSSIL_TEST_CASE(c_test_soap_count_rotbrain_with_punctuation) {
151151
ASSUME_ITS_EQUAL_I32(2, fossil_soap_count_rotbrain(input));
152152
}
153153

154-
FOSSIL_TEST_CASE(c_test_soap_context_aware_offensive) {
155-
char input[] = "This is a test with curse1 and racist_phrase1.";
156-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
157-
}
158-
159-
FOSSIL_TEST_CASE(c_test_soap_context_aware_rotbrain) {
160-
char input[] = "This is a test with lol and brb.";
161-
ASSUME_ITS_EQUAL_I32(2, fossil_soap_context_aware(input));
162-
}
163-
164-
FOSSIL_TEST_CASE(c_test_soap_context_aware_clean) {
165-
char input[] = "This is a clean sentence.";
166-
ASSUME_ITS_EQUAL_I32(0, fossil_soap_context_aware(input));
167-
}
168-
169-
FOSSIL_TEST_CASE(c_test_soap_context_aware_mixed) {
170-
char input[] = "This is a test with curse1 and lol.";
171-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
172-
}
173-
174-
FOSSIL_TEST_CASE(c_test_soap_context_aware_case_insensitive) {
175-
char input[] = "This is a test with CuRsE1 and LoL.";
176-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
177-
}
178-
179-
FOSSIL_TEST_CASE(c_test_soap_context_aware_with_punctuation) {
180-
char input[] = "This is a test with curse1, and lol!";
181-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
182-
}
183-
184-
FOSSIL_TEST_CASE(c_test_soap_context_aware_no_offensive_or_rotbrain) {
185-
char input[] = "This is a test with no offensive or rotbrain words.";
186-
ASSUME_ITS_EQUAL_I32(0, fossil_soap_context_aware(input));
187-
}
188-
189-
FOSSIL_TEST_CASE(c_test_soap_context_aware_only_rotbrain) {
190-
char input[] = "This is a test with lol and brb.";
191-
ASSUME_ITS_EQUAL_I32(2, fossil_soap_context_aware(input));
192-
}
193-
194-
FOSSIL_TEST_CASE(c_test_soap_context_aware_only_offensive) {
195-
char input[] = "This is a test with curse1 and racist_phrase1.";
196-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
197-
}
198-
199-
FOSSIL_TEST_CASE(c_test_soap_context_aware_mixed_case) {
200-
char input[] = "This is a test with CuRsE1 and LoL.";
201-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
202-
}
203-
204-
FOSSIL_TEST_CASE(c_test_soap_context_aware_with_special_characters) {
205-
char input[] = "This is a test with curse1@ and lol#.";
206-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
207-
}
208-
209-
FOSSIL_TEST_CASE(c_test_soap_context_aware_with_numbers) {
210-
char input[] = "This is a test with curse1 and lol123.";
211-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
212-
}
213-
214-
FOSSIL_TEST_CASE(c_test_soap_context_aware_with_mixed_content) {
215-
char input[] = "This is a test with curse1, lol, and clean words.";
216-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
217-
}
218-
219-
FOSSIL_TEST_CASE(c_test_soap_context_aware_with_spaces) {
220-
char input[] = "This is a test with curse1 and lol .";
221-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
222-
}
223-
224-
FOSSIL_TEST_CASE(c_test_soap_context_aware_with_tabs) {
225-
char input[] = "This is a test with\tcurse1\tand\tlol\t.";
226-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
227-
}
228-
229-
FOSSIL_TEST_CASE(c_test_soap_context_aware_with_newlines) {
230-
char input[] = "This is a test with\ncurse1\nand\nlol\n.";
231-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
232-
}
233-
234-
FOSSIL_TEST_CASE(c_test_soap_context_aware_with_mixed_whitespace) {
235-
char input[] = "This is a test with \t\ncurse1 \t\nand \t\nlol \t\n.";
236-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
237-
}
238-
239-
FOSSIL_TEST_CASE(c_test_soap_context_aware_with_empty_string) {
240-
char input[] = "";
241-
ASSUME_ITS_EQUAL_I32(0, fossil_soap_context_aware(input));
242-
}
243-
244-
FOSSIL_TEST_CASE(c_test_soap_context_aware_with_null_string) {
245-
ASSUME_ITS_EQUAL_I32(0, fossil_soap_context_aware(NULL));
246-
}
247-
248154
// * * * * * * * * * * * * * * * * * * * * * * * *
249155
// * Fossil Logic Test Pool
250156
// * * * * * * * * * * * * * * * * * * * * * * * *

code/tests/cases/test_soap.cpp

Lines changed: 0 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -130,100 +130,6 @@ FOSSIL_TEST_CASE(cpp_test_soap_count_rotbrain_with_punctuation) {
130130
ASSUME_ITS_EQUAL_I32(2, fossil_soap_count_rotbrain(input));
131131
}
132132

133-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_offensive) {
134-
char input[] = "This is a test with curse1 and racist_phrase1.";
135-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
136-
}
137-
138-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_rotbrain) {
139-
char input[] = "This is a test with lol and brb.";
140-
ASSUME_ITS_EQUAL_I32(2, fossil_soap_context_aware(input));
141-
}
142-
143-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_clean) {
144-
char input[] = "This is a clean sentence.";
145-
ASSUME_ITS_EQUAL_I32(0, fossil_soap_context_aware(input));
146-
}
147-
148-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_mixed) {
149-
char input[] = "This is a test with curse1 and lol.";
150-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
151-
}
152-
153-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_case_insensitive) {
154-
char input[] = "This is a test with CuRsE1 and LoL.";
155-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
156-
}
157-
158-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_punctuation) {
159-
char input[] = "This is a test with curse1, and lol!";
160-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
161-
}
162-
163-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_no_offensive_or_rotbrain) {
164-
char input[] = "This is a test with no offensive or rotbrain words.";
165-
ASSUME_ITS_EQUAL_I32(0, fossil_soap_context_aware(input));
166-
}
167-
168-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_only_rotbrain) {
169-
char input[] = "This is a test with lol and brb.";
170-
ASSUME_ITS_EQUAL_I32(2, fossil_soap_context_aware(input));
171-
}
172-
173-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_only_offensive) {
174-
char input[] = "This is a test with curse1 and racist_phrase1.";
175-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
176-
}
177-
178-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_mixed_case) {
179-
char input[] = "This is a test with CuRsE1 and LoL.";
180-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
181-
}
182-
183-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_special_characters) {
184-
char input[] = "This is a test with curse1@ and lol#.";
185-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
186-
}
187-
188-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_numbers) {
189-
char input[] = "This is a test with curse1 and lol123.";
190-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
191-
}
192-
193-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_mixed_content) {
194-
char input[] = "This is a test with curse1, lol, and clean words.";
195-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
196-
}
197-
198-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_spaces) {
199-
char input[] = "This is a test with curse1 and lol .";
200-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
201-
}
202-
203-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_tabs) {
204-
char input[] = "This is a test with\tcurse1\tand\tlol\t.";
205-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
206-
}
207-
208-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_newlines) {
209-
char input[] = "This is a test with\ncurse1\nand\nlol\n.";
210-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
211-
}
212-
213-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_mixed_whitespace) {
214-
char input[] = "This is a test with \t\ncurse1 \t\nand \t\nlol \t\n.";
215-
ASSUME_ITS_EQUAL_I32(1, fossil_soap_context_aware(input));
216-
}
217-
218-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_empty_string) {
219-
char input[] = "";
220-
ASSUME_ITS_EQUAL_I32(0, fossil_soap_context_aware(input));
221-
}
222-
223-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_null_string) {
224-
ASSUME_ITS_EQUAL_I32(0, fossil_soap_context_aware(NULL));
225-
}
226-
227133
FOSSIL_TEST_CASE(cpp_test_soap_sanitize_empty_string) {
228134
char input[] = "";
229135
char expected[] = "";
@@ -288,46 +194,6 @@ FOSSIL_TEST_CASE(cpp_test_soap_sanitize_with_punctuation) {
288194
ASSUME_ITS_EQUAL_CSTR(expected, input);
289195
}
290196

291-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_numbers_and_special_characters) {
292-
char input[] = "This is a test with curse1@123 and lol#456.";
293-
ASSUME_ITS_EQUAL_I32(1, fossil::io::Soap::context_aware(input));
294-
}
295-
296-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_mixed_case_and_punctuation) {
297-
char input[] = "This is a test with CuRsE1! and LoL?.";
298-
ASSUME_ITS_EQUAL_I32(1, fossil::io::Soap::context_aware(input));
299-
}
300-
301-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_multiple_offensive_and_rotbrain) {
302-
char input[] = "This is a test with curse1, curse2, lol, and brb.";
303-
ASSUME_ITS_EQUAL_I32(2, fossil::io::Soap::context_aware(input));
304-
}
305-
306-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_only_special_characters) {
307-
char input[] = "!@#$%^&*()";
308-
ASSUME_ITS_EQUAL_I32(0, fossil::io::Soap::context_aware(input));
309-
}
310-
311-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_only_numbers) {
312-
char input[] = "1234567890";
313-
ASSUME_ITS_EQUAL_I32(0, fossil::io::Soap::context_aware(input));
314-
}
315-
316-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_mixed_numbers_and_words) {
317-
char input[] = "This is a test with 123curse1 and 456lol.";
318-
ASSUME_ITS_EQUAL_I32(1, fossil::io::Soap::context_aware(input));
319-
}
320-
321-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_unicode_characters) {
322-
char input[] = "This is a test with curse1 and lol 😊.";
323-
ASSUME_ITS_EQUAL_I32(1, fossil::io::Soap::context_aware(input));
324-
}
325-
326-
FOSSIL_TEST_CASE(cpp_test_soap_context_aware_with_long_text) {
327-
char input[] = "This is a very long test with multiple curse1, curse2, lol, and brb words to check the performance and accuracy of the context aware method.";
328-
ASSUME_ITS_EQUAL_I32(2, fossil::io::Soap::context_aware(input));
329-
}
330-
331197
// * * * * * * * * * * * * * * * * * * * * * * * *
332198
// * Fossil Logic Test Pool
333199
// * * * * * * * * * * * * * * * * * * * * * * * *
@@ -345,25 +211,6 @@ FOSSIL_TEST_GROUP(cpp_soap_tests) {
345211
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_is_rotbrain_case_insensitive);
346212
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_count_rotbrain_mixed_case);
347213
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_sanitize_synonyms);
348-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_offensive);
349-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_rotbrain);
350-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_clean);
351-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_mixed);
352-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_case_insensitive);
353-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_punctuation);
354-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_no_offensive_or_rotbrain);
355-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_only_rotbrain);
356-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_only_offensive);
357-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_mixed_case);
358-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_special_characters);
359-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_numbers);
360-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_mixed_content);
361-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_spaces);
362-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_tabs);
363-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_newlines);
364-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_mixed_whitespace);
365-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_empty_string);
366-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_null_string);
367214

368215
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_sanitize_empty_string);
369216
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_sanitize_only_offensive);
@@ -375,14 +222,6 @@ FOSSIL_TEST_GROUP(cpp_soap_tests) {
375222
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_count_offensive_mixed_content);
376223
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_count_rotbrain_mixed_content);
377224
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_sanitize_with_punctuation);
378-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_numbers_and_special_characters);
379-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_mixed_case_and_punctuation);
380-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_multiple_offensive_and_rotbrain);
381-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_only_special_characters);
382-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_only_numbers);
383-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_mixed_numbers_and_words);
384-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_unicode_characters);
385-
FOSSIL_TEST_ADD(cpp_soap_suite, cpp_test_soap_context_aware_with_long_text);
386225

387226
FOSSIL_TEST_REGISTER(cpp_soap_suite);
388227
}

0 commit comments

Comments
 (0)