From 7c5cd5ec89c0d90c3dbac032c61ee04468ecdc87 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 30 Jul 2014 12:31:29 +0900 Subject: [PATCH] [SD11] Add script checks for Myanmar, Sinhala, Thai and Telugu Bug: 15840116 Change-Id: I1264fdeea0d4739ca0f360f4934d06e5a824d4e5 --- java/res/values/attrs.xml | 4 ++++ java/res/xml/keyboard_layout_set_myanmar.xml | 2 ++ java/res/xml/keyboard_layout_set_sinhala.xml | 2 ++ java/res/xml/keyboard_layout_set_telugu.xml | 2 ++ java/res/xml/keyboard_layout_set_thai.xml | 2 ++ .../inputmethod/latin/utils/ScriptUtils.java | 21 +++++++++++++++++++ 6 files changed, 33 insertions(+) diff --git a/java/res/values/attrs.xml b/java/res/values/attrs.xml index 9d828ef91..80a657346 100644 --- a/java/res/values/attrs.xml +++ b/java/res/values/attrs.xml @@ -490,6 +490,10 @@ + + + + diff --git a/java/res/xml/keyboard_layout_set_myanmar.xml b/java/res/xml/keyboard_layout_set_myanmar.xml index 5c823b263..5af8c064e 100644 --- a/java/res/xml/keyboard_layout_set_myanmar.xml +++ b/java/res/xml/keyboard_layout_set_myanmar.xml @@ -20,6 +20,8 @@ + + + + mSpellCheckerLanguageToScript; static { // List of the supported languages and their associated script. We won't check @@ -132,6 +136,23 @@ public class ScriptUtils { case SCRIPT_LAO: // The Lao block is U+0E80..U+0EFF return (codePoint >= 0xE80 && codePoint <= 0xEFF); + case SCRIPT_MYANMAR: + // Myanmar has three unicode blocks : + // Myanmar U+1000..U+109F + // Myanmar extended-A U+AA60..U+AA7F + // Myanmar extended-B U+A9E0..U+A9FF + return (codePoint >= 0x1000 && codePoint <= 0x109F + || codePoint >= 0xAA60 && codePoint <= 0xAA7F + || codePoint >= 0xA9E0 && codePoint <= 0xA9FF); + case SCRIPT_SINHALA: + // Sinhala unicode block is U+0D80..U+0DFF + return (codePoint >= 0xD80 && codePoint <= 0xDFF); + case SCRIPT_THAI: + // Thai unicode block is U+0E00..U+0E7F + return (codePoint >= 0xE00 && codePoint <= 0xE7F); + case SCRIPT_TELUGU: + // Telugu unicode block is U+0C00..U+0C7F + return (codePoint >= 0xC00 && codePoint <= 0xC7F); case SCRIPT_UNKNOWN: return true; default: