[grazie] IJPL-224218 Adjust number of tokens

GitOrigin-RevId: 8a66ca3a5b408907aee7d6edd9deba27794fd61c
This commit is contained in:
Ilia Permiashkin
2025-12-19 00:10:54 +00:00
committed by intellij-monorepo-bot
parent f87999b305
commit 498dd67191
@@ -63,7 +63,8 @@ class GrazieCheckers(coroutineScope: CoroutineScope) : GrazieStateLifecycle {
return synchronized(speller) {
computeWithClassLoader<Boolean, Throwable>(GraziePlugin.classLoader) {
val sentence = tool.getRawAnalyzedSentence(word)
if (sentence.nonWhitespaceTokenCount == 1) return@computeWithClassLoader !speller.isMisspelled(word)
// First token is always sentence start
if (sentence.nonWhitespaceTokenCount <= 2) return@computeWithClassLoader !speller.isMisspelled(word)
if (speller.match(sentence).isEmpty()) {
if (!speller.isMisspelled(word)) true
else {