FFA Foul Language Processor

Enhanced script for detecting and counting occurrences of specific words.

此脚本不应直接安装,它是一个供其他脚本使用的外部库。如果您需要使用该库,请在脚本元属性加入:// @require https://update.gf.qytechs.cn/scripts/515949/1509840/FFA%20Foul%20Language%20Processor.js

  1. // ==UserScript==
  2. // @name FFA Foul Language Processor
  3. // @licence MIT
  4. // @author krcanacu & jgonzzz
  5. // @namespace FFA_FL_Script
  6. // @description Enhanced script for detecting and counting occurrences of specific words.
  7. // @match http://vcc-review-caption-alpha.corp.amazon.com/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=amazon.com
  9. // @version 2.0.4
  10. // @grant none
  11. // @downloadURL https://update.gf.qytechs.cn/scripts/515949/FFA%20Foul%20Language%20Enhanced.user.js
  12. // @updateURL https://update.gf.qytechs.cn/scripts/515949/FFA%20Foul%20Language%20Enhanced.user.js
  13. // ==/UserScript==
  14.  
  15. (function() {
  16. LoadFL();
  17. })();
  18.  
  19. function LoadFL(){
  20.  
  21. //Keywords definition
  22. // Severe Words //
  23. //RoDS = Racial or derogatory slurs
  24. const RoDSWords = ["nigger", "beaner", "nigga", "coon", "negro", "dyke", "chink", "faggy", "chinky", "faggot", "jap", "fag", "paki", "retard", "retarded", "wog", "queer", "gook", "kike"];
  25.  
  26. //Fuckwords = Self explanatory
  27. const Fuckwords = ["fuck", "fucked", "fucker", "fucking", "fuckin", "motherfuck", "motherfucker", "fuckface"];
  28.  
  29. //EuSR = Explicit use of sexual terminology
  30. const EuSRwords = ["porn", "ho", "pornography", "hoe", "hoes", "porno", "wanker", "masturbate", "masturbation", "jerk off", "hand job", "blowjob", "whore", "hooker", "stripper", "prostitution", "prostitute", "sex worker", "brothel", "pimp"];
  31.  
  32. //ERoSV = Explicit references of sexual violence
  33. const ERoSV = ["sexual assault", "sexual abuse", "rape", "rapist", "raped", "molest", "molested"];
  34.  
  35. //RtHD = References to hard drugs
  36. const RtHDwords = ["LSD", "crack", "meth", "acid", "meth-head", "molly", "methamphetamine", "ecstasy", "heroin", "cocaine", "MDMA", "DMT"];
  37.  
  38. //NCSR = Non-comedic sexual reference
  39. const NCSRwords = ["orgy", "BDSM", "dildo", "vibrator", "lubricant", "orgasm"];
  40.  
  41. // Moderate words //
  42. //TenIoS = 10+ Instances of shit, ass, asshole, bitch, piss, etc.
  43. const TenIoSwords = ["shit", "ass", "asshole", "bitch", "piss"];
  44.  
  45. // DiSR = Dick/cock, pussy/cunt, cum in a sexual reference
  46. const DiSRwords = ["dick", "cock", "pussy", "cunt", "cum"];
  47.  
  48. //RtDUwords = References to drugs or drug use
  49. const RtDUwords = ["weed", "opioids", "marihuana", "opium", "marijuana", "pot", "cannabis", "mary jane", "opioid"];
  50.  
  51. //CSR = Comedic sexual reference
  52. const CSRwords = [""];
  53.  
  54. //RtS = References to Suicide
  55. const RtSWords = ["suicide", "self-harm", "kill myself", "kill herself", "kill himself", "kill yourself"];
  56.  
  57. //NErtSV = Non-explicit references to Sexual Violence
  58. const SErtSV = ["sexual harassment"];
  59.  
  60. //MuoSR = Moderate use of sexual references
  61. const MuoSRWords = ["harlot"];
  62.  
  63. // Categories config of threshold and label
  64. const targetCategories = [
  65. { words: RoDSWords, threshold: 1, label: "Racial or derogatory slurs" },
  66. { words: Fuckwords, threshold: 3, label: "3+ instances of fuck" },
  67. { words: EuSRwords, threshold: 1, label: "Explicit use of sexual terminology" },
  68. { words: ERoSV, threshold: 1, label: "Explicit references to sexual violence" },
  69. { words: RtHDwords, threshold: 1, label: "References to hard drugs" },
  70. { words: NCSRwords, threshold: 1, label: "Non-comedic sexual reference" },
  71. { words: TenIoSwords, threshold: 10, label: "10+ Instances of shit, ass, asshole, bitch, piss, etc." },
  72. { words: DiSRwords, threshold: 2, label: "Dick/cock, pussy/cunt, cum in a sexual reference" },
  73. { words: RtDUwords, threshold: 3, label: "References to drugs or drug use" },
  74. { words: CSRwords, threshold: 3, label: "Comedic sexual reference" },
  75. { words: RtSWords, threshold: 3, label: "References to Suicide"},
  76. { words: MuoSRWords, threshold: 3, label: "Moderate use of Sexual References"}
  77. ];
  78.  
  79. const subTitleDiv = document.getElementById('full-caps');
  80.  
  81. if (subTitleDiv) {
  82. const textNodes = document.createTreeWalker(subTitleDiv, NodeFilter.SHOW_TEXT, null, false);
  83. let categoryCounts = {};
  84. let detectedWords = {};
  85.  
  86. targetCategories.forEach(category => {
  87. categoryCounts[category.label] = 0;
  88. detectedWords[category.label] = new Set();
  89. });
  90.  
  91. while (textNodes.nextNode()) {
  92. const textContent = textNodes.currentNode.textContent.toLowerCase();
  93. const lines = textContent.split('\n');
  94. lines.forEach(line => {
  95. targetCategories.forEach(category => {
  96. category.words.forEach(word => {
  97. const regex = new RegExp(`\\b${word}(s?|ers|es|s)?\\b`, 'gi');
  98. if (regex.test(line)) {
  99. categoryCounts[category.label]++;
  100. detectedWords[category.label].add(word);
  101. }
  102. });
  103. });
  104. });
  105. }
  106.  
  107. let popupContent = '';
  108. let foulLanguageDetected = false;
  109.  
  110. targetCategories.forEach(category => {
  111. if (categoryCounts[category.label] >= category.threshold) {
  112. const wordsList = [...detectedWords[category.label]].join(', ');
  113. popupContent += `${category.label}: ${categoryCounts[category.label]} (${wordsList})<br>`;
  114. foulLanguageDetected = true; // Mark that foul language was detected
  115. }
  116. });
  117.  
  118. // If no foul language was detected, add the fallback message
  119. if (!foulLanguageDetected) {
  120. popupContent = 'Not enough foul language was found, check the title for NFF content';
  121. }
  122.  
  123. if (popupContent.trim() !== '') {
  124. const popup = document.createElement('div');
  125. if (popupContent === 'Not enough foul language was found, check the title for NFF content') {
  126. popup.innerHTML = popupContent;
  127. } else {
  128. popup.innerHTML = `Possible NFF (check for ambiguity):<br>${popupContent}`;
  129. }
  130.  
  131. return(popup);
  132. }
  133. }
  134. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址