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
e94c2766
Commit
e94c2766
authored
12 years ago
by
Jean Chalard
Browse files
Options
Downloads
Patches
Plain Diff
Simplification again (A5)
Change-Id: Id3ba200e06244e6d13cf57d346001d61f85ef1a2
parent
6f8dfd92
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/StringUtils.java
+4
-5
4 additions, 5 deletions
java/src/com/android/inputmethod/latin/StringUtils.java
with
4 additions
and
5 deletions
java/src/com/android/inputmethod/latin/StringUtils.java
+
4
−
5
View file @
e94c2766
...
...
@@ -218,8 +218,6 @@ public final class StringUtils {
* {@link #CAP_MODE_SENTENCES}.
*/
public
static
int
getCapsMode
(
CharSequence
cs
,
int
reqModes
)
{
int
i
;
char
c
;
// Quick description of what we want to do:
// CAP_MODE_CHARACTERS is always on.
// CAP_MODE_WORDS is on if there is some whitespace before the cursor.
...
...
@@ -245,8 +243,9 @@ public final class StringUtils {
// it may look like a right parenthesis for example. We also include double quote and
// single quote since they aren't start punctuation in the unicode sense, but should still
// be skipped for English. TODO: does this depend on the language?
int
i
;
for
(
i
=
cs
.
length
();
i
>
0
;
i
--)
{
c
=
cs
.
charAt
(
i
-
1
);
final
char
c
=
cs
.
charAt
(
i
-
1
);
if
(
c
!=
'"'
&&
c
!=
'\''
&&
Character
.
getType
(
c
)
!=
Character
.
START_PUNCTUATION
)
{
break
;
}
...
...
@@ -294,14 +293,14 @@ public final class StringUtils {
// it's wrong for German, it's wrong for Spanish, and possibly everything else.
// (note that American rules and British rules have nothing to do with en_US and en_GB,
// as both rules are used in both countries - it's merely a name for the set of rules)
c
=
cs
.
charAt
(
j
-
1
);
final
char
c
=
cs
.
charAt
(
j
-
1
);
if
(
c
!=
'"'
&&
c
!=
'\''
&&
Character
.
getType
(
c
)
!=
Character
.
END_PUNCTUATION
)
{
break
;
}
}
if
(
j
<=
0
)
return
TextUtils
.
CAP_MODE_CHARACTERS
&
reqModes
;
c
=
cs
.
charAt
(
j
-
1
);
char
c
=
cs
.
charAt
(
j
-
1
);
if
(
c
==
'.'
||
c
==
'?'
||
c
==
'!'
)
{
// Here we found a marker for sentence end (we consider these to be one of
// either . or ? or ! only). So this is probably the end of a sentence, but if we
...
...
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