IDEA-76562 Suppressing spell checking for eastern Asian languages looks incomplete

This commit is contained in:
Maxim.Mossienko
2011-11-15 15:35:38 +04:00
parent 2d6bb54d9f
commit fe5f20c043
3 changed files with 28 additions and 13 deletions
@@ -84,7 +84,7 @@ public class IdentifierSplitter extends BaseSplitter {
}
@NotNull
public static List<TextRange> splitByCase(@NotNull String text, @NotNull TextRange range) {
private static List<TextRange> splitByCase(@NotNull String text, @NotNull TextRange range) {
//System.out.println("text = " + text + " range = " + range);
List<TextRange> result = new ArrayList<TextRange>();
int i = range.getStartOffset();
@@ -92,6 +92,21 @@ public class IdentifierSplitter extends BaseSplitter {
int prevType = Character.MATH_SYMBOL;
while (i < range.getEndOffset()) {
final char ch = text.charAt(i);
if (ch >= '\u3040' && ch <= '\u309f' || // Hiragana
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
) {
if (s >= 0) {
add(text, result, i, s);
s = -1;
}
prevType = Character.MATH_SYMBOL;
++i;
continue;
}
final int type = Character.getType(ch);
if (type == Character.LOWERCASE_LETTER ||
type == Character.UPPERCASE_LETTER ||
@@ -52,17 +52,17 @@ public class PlainTextSplitter extends BaseSplitter {
if (Verifier.checkCharacterData(substring) != null) {
return;
}
for(int i = 0; i < text.length(); ++i) {
final char ch = text.charAt(i);
if (ch >= '\u3040' && ch <= '\u309f' || // Hiragana
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
) {
return;
}
}
//for(int i = 0; i < text.length(); ++i) {
// final char ch = text.charAt(i);
// if (ch >= '\u3040' && ch <= '\u309f' || // Hiragana
// 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
// ) {
// return;
// }
//}
List<TextRange> toCheck;
if (text.indexOf('@')>0) {
@@ -16,7 +16,7 @@
/** CJK Compatibility Ideographs (F900 - FAFF)
* 﨎鶴﨎鶴﨎鶴
*/
/* 私は<TYPO>Jaba</TYPO>が好きです。私は<TYPO>Jaba</TYPO>が好きです。*/
/**
* プロセス毎に使われるコールスタックは一つだけ !!!
*/