diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml index bdc1e318..9d169234 100644 --- a/.github/workflows/translations.yml +++ b/.github/workflows/translations.yml @@ -65,7 +65,7 @@ jobs: run: | echo "Translations are: '${{ steps.google-translate.outputs.text }}'" echo "${{ steps.google-translate.outputs.text }}" | sed 's/ ; /\n/g' > translated_texts.txt - cat translated_texts.txt | ./scripts/checkProfanity.sh + ./scripts/checkProfanity.sh translated_texts.txt shell: sh - name: Upload Raw Translations uses: actions/upload-artifact@v3 diff --git a/scripts/checkProfanity.py b/scripts/checkProfanity.py index d83d5c41..e1222ecb 100755 --- a/scripts/checkProfanity.py +++ b/scripts/checkProfanity.py @@ -1,12 +1,13 @@ #!/usr/bin/python -import sys from profanity_check import predict, predict_prob -import joblib +import sys file = open("suspicious_texts.txt", "a") -for line in sys.stdin: +source = open(sys.argv[1], "r") +lines = source.readlines() +for line in lines: print("Checking: "+str(line.rstrip())) prediction = predict_prob([line.rstrip()]) if prediction[0] > 0.5: