Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto moderation feature #3

Open
noobling opened this issue Jun 24, 2019 · 3 comments
Open

Auto moderation feature #3

noobling opened this issue Jun 24, 2019 · 3 comments
Assignees

Comments

@noobling
Copy link
Member

A function(s) that with given text input can determine if the content is good or bad or places it on some sort of scale 0-100.

@Jai-C
Copy link
Collaborator

Jai-C commented Jul 15, 2019

Hi, I just had a couple of questions as I am not too familiar with the NextJS and React and am not sure exactly what part of the site this issue pertains to:

  • I was just wondering where this will be implemented under the current framework?
  • What language would be best for this?

Also, what sort of content will be inputted? I was thinking if it is comments on a web page for example, I could scan for key words - but what content is considered 'good'?

@Jai-C
Copy link
Collaborator

Jai-C commented Jul 28, 2019

Hi, Apologies for the late post, I'm not sure exactly what section of the website this section pertains to so I will paste my function here. I have provided a basic framework in JavaScript to determine if a passage of text is good or bad (function will return true or false). Please let me know if there is anything I can do towards producing a 0-100 scale as I am unsure of the context.

function Moderation_isAcceptablePassage(inputText) {
   var wordsNotAllowed = ['badWord1', 'badWord2'] ; // Change these to the list of words not allowed
   var words = inputText.split(' ');
    for (var i=0; i<words.length; i=i+1) {
    	for (var j = 0; j <wordsNotAllowed.length ; j = j + 1) {
        	var currentWord = words[i].replace('.','');
            currentWord = currentWord.replace('_', '');
            currentWord = currentWord.replace('*', '');
            currentWord = currentWord.replace('!', '');
            currentWord = currentWord.replace('?', '');
        	if (currentWord.localeCompare(wordsNotAllowed[j]) == 0) {
            	return false;
            }
        }
		
	}
	return true;
}

-- Jai

@noobling
Copy link
Member Author

noobling commented Jul 29, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants