aboutsummaryrefslogtreecommitdiffstats
path: root/java/res
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2011-05-09 16:54:07 +0900
committerJean Chalard <jchalard@google.com>2011-05-09 19:15:11 +0900
commit863f95b6052e5d9d4fb1ac5dc283c464db9f29c3 (patch)
treef7a46644d12ced5f71d91a2dae56c7a0345bbbff /java/res
parentaac2d87dcf8f199d942c61a1115746d61f181675 (diff)
downloadlatinime-863f95b6052e5d9d4fb1ac5dc283c464db9f29c3.tar.gz
latinime-863f95b6052e5d9d4fb1ac5dc283c464db9f29c3.tar.xz
latinime-863f95b6052e5d9d4fb1ac5dc283c464db9f29c3.zip
Improve magic space handling.
Split symbols into: - Symbols that should swap themselves with a magic space. - Symbols that should remove the magic space. - Symbols that should transform the magic space into a real space. Also, have symbols inserted from the suggestion strip always consider the space before them to be magic. Also, do minor refactoring to remove useless variables or make clearer how to carry some symbol-related information. Bug: 4391347 Change-Id: Ie2308a62c8fef55e3610897c0f58943acb7aa8c9
Diffstat (limited to 'java/res')
-rw-r--r--java/res/values-fr/donottranslate.xml12
-rw-r--r--java/res/values-it/donottranslate.xml4
-rw-r--r--java/res/values/donottranslate.xml15
3 files changed, 21 insertions, 10 deletions
diff --git a/java/res/values-fr/donottranslate.xml b/java/res/values-fr/donottranslate.xml
index 6c3536210..09c37e31a 100644
--- a/java/res/values-fr/donottranslate.xml
+++ b/java/res/values-fr/donottranslate.xml
@@ -18,8 +18,12 @@
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Symbols that are commonly considered word separators in this language -->
- <string name="word_separators">.\u0009\u0020,;:!?\n()[]*&amp;@{}/&lt;&gt;_+=|\u0022</string>
- <!-- Symbols that are sentence separators, for purposes of making it hug the last sentence. -->
- <string name="sentence_separators">.,</string>
+ <!-- Symbols that should be swapped with a magic space -->
+ <string name="magic_space_swapping_symbols">.,\u0022)]}</string>
+ <!-- Symbols that should strip a magic space -->
+ <string name="magic_space_stripping_symbols">\u0009\u0020\u0027\n-/_</string>
+ <!-- Symbols that should promote magic spaces into real space -->
+ <string name="magic_space_promoting_symbols">;:!?([*&amp;@{&lt;&gt;+=|</string>
+ <!-- Symbols that do NOT separate words -->
+ <string name="non_word_separator_symbols">\u0027</string>
</resources>
diff --git a/java/res/values-it/donottranslate.xml b/java/res/values-it/donottranslate.xml
index 3e3f3ef2a..adb2a9a9d 100644
--- a/java/res/values-it/donottranslate.xml
+++ b/java/res/values-it/donottranslate.xml
@@ -18,6 +18,6 @@
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Symbols that are commonly considered word separators in this language -->
- <string name="word_separators">.\u0009\u0020,;:!?\'\n()[]*&amp;@{}/&lt;&gt;_+=|\u0022</string>
+ <!-- Symbols that do NOT separate words -->
+ <string name="non_word_separator_symbols"></string>
</resources>
diff --git a/java/res/values/donottranslate.xml b/java/res/values/donottranslate.xml
index 6a1069e99..1cdae3d81 100644
--- a/java/res/values/donottranslate.xml
+++ b/java/res/values/donottranslate.xml
@@ -18,12 +18,19 @@
*/
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
- <!-- Symbols that are commonly considered word separators in this language -->
- <string name="word_separators">.\u0009\u0020,;:!?\n()[]*&amp;@{}/&lt;&gt;_+=|\u0022</string>
- <!-- Symbols that are sentence separators, for purposes of making it hug the last sentence. -->
- <string name="sentence_separators">.,!?)</string>
<!-- Symbols that are suggested between words -->
<string name="suggested_punctuations">!?,\u0022\u0027:();-/@_</string>
+ <!-- Symbols that should be swapped with a magic space -->
+ <string name="magic_space_swapping_symbols">.,;:!?)]}\u0022</string>
+ <!-- Symbols that should strip a magic space -->
+ <string name="magic_space_stripping_symbols">\u0009\u0020\n/_\u0027-</string>
+ <!-- Symbols that should convert magic spaces into real space -->
+ <string name="magic_space_promoting_symbols">([*&amp;@{&lt;&gt;+=|</string>
+ <!-- Symbols that do NOT separate words -->
+ <string name="non_word_separator_symbols">\u0027-</string>
+ <!-- Word separator list is the union of all symbols except those that are not separators:
+ magic_space_swapping_symbols | magic_space_stripping_symbols |
+ magic_space_neutral_symbols \ non_word_separator_symbols -->
<!-- Label for ALT modifier key. Must be short to fit on key! -->
<string name="label_alt_key">ALT</string>