mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
IJPL-33113 False-positive typo check on English-Korean mixed text
Merge-request: IJ-MR-164690 Merged-by: Ilia Permiashkin <ilia.permiashkin@jetbrains.com> GitOrigin-RevId: 9f8e6382c4213f29aa2d3da9f30e9ce97211b101
This commit is contained in:
committed by
intellij-monorepo-bot
parent
31d24cf1c1
commit
ae21dfa507
@@ -6,7 +6,7 @@ import ai.grazie.spell.lists.WordList
|
||||
|
||||
internal class WordListAdapter : WordList, EditableWordListAdapter() {
|
||||
fun isAlien(word: String): Boolean {
|
||||
return dictionaries.values.all { it.contains(word) == null } && !aggregator.contains(word)
|
||||
return !dictionaries.values.any { it.contains(word) ?: false } && !aggregator.contains(word)
|
||||
}
|
||||
|
||||
override fun contains(word: String, caseSensitive: Boolean): Boolean {
|
||||
|
||||
@@ -81,7 +81,8 @@ public class IdentifierSplitter extends BaseSplitter {
|
||||
ch >= '\u30A0' && ch <= '\u30ff' || // Katakana
|
||||
ch >= '\u4E00' && ch <= '\u9FFF' || // CJK Unified ideographs
|
||||
ch >= '\uF900' && ch <= '\uFAFF' || // CJK Compatibility Ideographs
|
||||
ch >= '\uFF00' && ch <= '\uFFEF' //Halfwidth and Fullwidth Forms of Katakana & Fullwidth ASCII variants
|
||||
ch >= '\uFF00' && ch <= '\uFFEF' || // Halfwidth and Fullwidth Forms of Katakana & Fullwidth ASCII variants
|
||||
ch >= '\uAC00' && ch <= '\uD7AF' // Hangul Syllables (Korean)
|
||||
) {
|
||||
if (s >= 0) {
|
||||
add(text, result, i, s);
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
package com.intellij.spellchecker.inspection
|
||||
|
||||
import com.intellij.spellchecker.SpellCheckerManager
|
||||
import junit.framework.TestCase
|
||||
|
||||
|
||||
class SpellcheckerCornerCasesTest : SpellcheckerInspectionTestCase() {
|
||||
@@ -10,6 +9,21 @@ class SpellcheckerCornerCasesTest : SpellcheckerInspectionTestCase() {
|
||||
//should not end up with OOM
|
||||
val manager = SpellCheckerManager.getInstance(project)
|
||||
val suggestions = manager.getSuggestions("MYY_VERRY_LOOONG_WORDD_WOTH_A_LOTTT_OFFF_MISAKES")
|
||||
TestCase.assertTrue(suggestions.isNotEmpty())
|
||||
assertTrue(suggestions.isNotEmpty())
|
||||
}
|
||||
|
||||
fun `test that korean language is treated as alien`() {
|
||||
myFixture.enableInspections(*getInspectionTools())
|
||||
myFixture.configureByText("a.txt", """
|
||||
<TYPO descr="Typo: In word 'loadd'">loadd</TYPO>이벤트가
|
||||
이벤트가<TYPO descr="Typo: In word 'loadd'">loadd</TYPO>타입의
|
||||
타입의<TYPO descr="Typo: In word 'loadd'">loadd</TYPO>
|
||||
|
||||
load이벤트가 발생하면 Event타입의 이벤트 객체가 생성된다.
|
||||
A뉴타운 112㎡형 분양가는 ㎡당 430만원, 강남 B아파트 ㎡당 1100만원 선 무너져. '사랑'은 85개 스크린에서 21만9천104명을 모아 '본 얼티메이텀'에 뒤졌으나 전국 400개 스크린에서는 86만7천287명을 동원, 서울보다는 지방 관객의 사랑을 더 많이 받은 것으로 나타났다.
|
||||
}
|
||||
}
|
||||
""".trimIndent())
|
||||
myFixture.checkHighlighting()
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user