Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
0175d7da
Commit
0175d7da
authored
14 years ago
by
Ken Wakasa
Browse files
Options
Downloads
Patches
Plain Diff
Add additional punctuations to suggestion strip. Bug: 2729632
Change-Id: I5a3d47fee2a09da06b395529c4eccce6d14ecb9d
parent
4ee3676c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
java/res/values/donottranslate.xml
+2
-2
2 additions, 2 deletions
java/res/values/donottranslate.xml
java/src/com/android/inputmethod/latin/LatinIME.java
+13
-7
13 additions, 7 deletions
java/src/com/android/inputmethod/latin/LatinIME.java
with
15 additions
and
9 deletions
java/res/values/donottranslate.xml
+
2
−
2
View file @
0175d7da
...
...
@@ -21,9 +21,9 @@
<!-- Symbols that are commonly considered word separators in this language -->
<string
name=
"word_separators"
>
.\u0009\u0020,;:!?\n()[]*
&
@{}/
<>
_+=|\u0022
</string>
<!-- Symbols that are sentence separators, for purposes of making it hug the last sentence. -->
<string
name=
"sentence_separators"
>
.,!?
</string>
<string
name=
"sentence_separators"
>
.,!?
)
</string>
<!-- Symbols that are suggested between words -->
<string
name=
"suggested_punctuations"
>
!?,@_
</string>
<string
name=
"suggested_punctuations"
>
!?,
\u0022\u0027:()-/
@_
</string>
<!-- Accented characters related to "d" -->
<string
name=
"alternates_for_d"
></string>
<!-- Accented characters related to "r" -->
...
...
This diff is collapsed.
Click to expand it.
java/src/com/android/inputmethod/latin/LatinIME.java
+
13
−
7
View file @
0175d7da
...
...
@@ -221,6 +221,7 @@ public class LatinIME extends InputMethodService
/* package */
String
mWordSeparators
;
private
String
mSentenceSeparators
;
private
String
mSuggestPuncs
;
private
VoiceInput
mVoiceInput
;
private
VoiceResults
mVoiceResults
=
new
VoiceResults
();
private
long
mSwipeTriggerTimeMillis
;
...
...
@@ -1116,7 +1117,7 @@ public class LatinIME extends InputMethodService
}
}
if
(
mKeyboardSwitcher
.
getInputView
().
isShifted
())
{
// TODO: This doesn't work with
ß
, need to fix it in the next release.
// TODO: This doesn't work with
[beta]
, need to fix it in the next release.
if
(
keyCodes
==
null
||
keyCodes
[
0
]
<
Character
.
MIN_CODE_POINT
||
keyCodes
[
0
]
>
Character
.
MAX_CODE_POINT
)
{
return
;
...
...
@@ -1549,7 +1550,8 @@ public class LatinIME extends InputMethodService
}
// If this is a punctuation, apply it through the normal key press
if
(
suggestion
.
length
()
==
1
&&
isWordSeparator
(
suggestion
.
charAt
(
0
)))
{
if
(
suggestion
.
length
()
==
1
&&
(
isWordSeparator
(
suggestion
.
charAt
(
0
))
||
isSuggestedPunctuation
(
suggestion
.
charAt
(
0
))))
{
// Word separators are suggested before the user inputs something.
// So, LatinImeLogger logs "" as a user's input.
LatinImeLogger
.
logOnClickSuggestion
(
...
...
@@ -1681,7 +1683,7 @@ public class LatinIME extends InputMethodService
return
separators
.
contains
(
String
.
valueOf
((
char
)
code
));
}
p
ublic
boolean
isSentenceSeparator
(
int
code
)
{
p
rivate
boolean
isSentenceSeparator
(
int
code
)
{
return
mSentenceSeparators
.
contains
(
String
.
valueOf
((
char
)
code
));
}
...
...
@@ -1952,14 +1954,18 @@ public class LatinIME extends InputMethodService
private
void
initSuggestPuncList
()
{
mSuggestPuncList
=
new
ArrayList
<
CharSequence
>();
S
tring
s
uggestPuncs
=
mResources
.
getString
(
R
.
string
.
suggested_punctuations
);
if
(
s
uggestPuncs
!=
null
)
{
for
(
int
i
=
0
;
i
<
s
uggestPuncs
.
length
();
i
++)
{
mSuggestPuncList
.
add
(
s
uggestPuncs
.
subSequence
(
i
,
i
+
1
));
m
SuggestPuncs
=
mResources
.
getString
(
R
.
string
.
suggested_punctuations
);
if
(
mS
uggestPuncs
!=
null
)
{
for
(
int
i
=
0
;
i
<
mS
uggestPuncs
.
length
();
i
++)
{
mSuggestPuncList
.
add
(
mS
uggestPuncs
.
subSequence
(
i
,
i
+
1
));
}
}
}
private
boolean
isSuggestedPunctuation
(
int
code
)
{
return
mSuggestPuncs
.
contains
(
String
.
valueOf
((
char
)
code
));
}
private
void
showOptionsMenu
()
{
AlertDialog
.
Builder
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
.
setCancelable
(
true
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment