<commit_before>package com.intellij.grazie.ide.fus

import com.intellij.grazie.ide.language.LanguageGrammarChecking
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomWhiteListRule

internal class GrazieFUSStrategyIDRule : CustomWhiteListRule() {
  override fun doValidate(data: String, context: EventContext): ValidationResultType {
    return if (data in LanguageGrammarChecking.getStrategies().map { it.getID() }.toSet()) {
      ValidationResultType.ACCEPTED
    }
    else {
      ValidationResultType.REJECTED
    }
  }

  override fun acceptRuleId(ruleId: String?) = ruleId == "grazie_strategy_id"
}<commit_msg>[Grazie] Fix GrazieFUSStrategyIDRule -- accept also default non-installed plugins<commit_after>package com.intellij.grazie.ide.fus

import com.intellij.grazie.ide.language.LanguageGrammarChecking
import com.intellij.internal.statistic.eventLog.validator.ValidationResultType
import com.intellij.internal.statistic.eventLog.validator.rules.EventContext
import com.intellij.internal.statistic.eventLog.validator.rules.impl.CustomWhiteListRule

internal class GrazieFUSStrategyIDRule : CustomWhiteListRule() {
  private val defaultEnabledStrategies = setOf("nl.rubensten.texifyidea:Latex", "org.asciidoctor.intellij.asciidoc:AsciiDoc")

  override fun doValidate(data: String, context: EventContext): ValidationResultType {
    return if (data in defaultEnabledStrategies || data in LanguageGrammarChecking.getStrategies().map { it.getID() }.toSet()) {
      ValidationResultType.ACCEPTED
    }
    else {
      ValidationResultType.REJECTED
    }
  }

  override fun acceptRuleId(ruleId: String?) = ruleId == "grazie_strategy_id"
}
{'fraction_non_alphanumeric': 0.09414340448823208, 'fraction_numerical': 0.0, 'mean_word_length': 5.720588235294118, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5632529', 'n_tokens_mistral': 585, 'n_tokens_neox': 574, 'n_words': 89}