Skip to content

Create a Word class for processing the values in the input files #8

@Trashboat-99

Description

@Trashboat-99

Description:
We need to have each word in the profanity.txt file to have a language level field. For each word in the file, a language level value associated with it.

Language Level Values: Normal, Warning, Illegal

This class needs to have the following logic:
-compare argument value to each word on the list
-if the argument value equals any of the words that have a language level value equal to "Normal" -> continue to next word.
-if argument value is equal to a word on the list that has a language level value equal to "Warning" -> return the following warning message "Warning! Watch your language!"
-increment a counter
-If the counter is greater than or equal to 3, return the following message "Three strikes and you're out! You are being removed from the chat room"
-end the client's connection to the server
-if argument value is equal to a word on the list that has a language level value equal to "Illegal" -> return the following warning message "[input value] is considered an illegal word. You are banned from the chat room". Then update the usernames.txt file so that the Allowed field flag is set to false.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions