am 7d57fc24: Clean up for Iba6eeb7981634e7ddb.
* commit '7d57fc248b397335d64609d428893b8c76493215': Clean up for Iba6eeb7981634e7ddb.main
commit
7e5fe7e6ab
|
@ -318,18 +318,18 @@ public final class BinaryDictionary extends Dictionary {
|
||||||
++len;
|
++len;
|
||||||
}
|
}
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
final int kindAndFlags = mOutputTypes[j];
|
final SuggestedWordInfo suggestedWordInfo =
|
||||||
if (blockOffensiveWords
|
new SuggestedWordInfo(new String(mOutputCodePoints, start, len),
|
||||||
&& 0 != (kindAndFlags & SuggestedWordInfo.KIND_FLAG_POSSIBLY_OFFENSIVE)
|
mOutputScores[j], mOutputTypes[j], this /* sourceDict */,
|
||||||
&& 0 == (kindAndFlags & SuggestedWordInfo.KIND_FLAG_EXACT_MATCH)) {
|
mSpaceIndices[j] /* indexOfTouchPointOfSecondWord */,
|
||||||
|
mOutputAutoCommitFirstWordConfidence[0]);
|
||||||
|
if (blockOffensiveWords && suggestedWordInfo.isPossiblyOffensive()
|
||||||
|
&& !suggestedWordInfo.isExactMatch()) {
|
||||||
// If we block potentially offensive words, and if the word is possibly
|
// If we block potentially offensive words, and if the word is possibly
|
||||||
// offensive, then we don't output it unless it's also an exact match.
|
// offensive, then we don't output it unless it's also an exact match.
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
suggestions.add(new SuggestedWordInfo(new String(mOutputCodePoints, start, len),
|
suggestions.add(suggestedWordInfo);
|
||||||
mOutputScores[j], kindAndFlags, this /* sourceDict */,
|
|
||||||
mSpaceIndices[j] /* indexOfTouchPointOfSecondWord */,
|
|
||||||
mOutputAutoCommitFirstWordConfidence[0]));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return suggestions;
|
return suggestions;
|
||||||
|
|
|
@ -296,16 +296,15 @@ public class SuggestedWords {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPossiblyOffensive() {
|
public boolean isPossiblyOffensive() {
|
||||||
return (mKindAndFlags & SuggestedWordInfo.KIND_FLAG_POSSIBLY_OFFENSIVE) != 0;
|
return (mKindAndFlags & KIND_FLAG_POSSIBLY_OFFENSIVE) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExactMatch() {
|
public boolean isExactMatch() {
|
||||||
return (mKindAndFlags & SuggestedWordInfo.KIND_FLAG_EXACT_MATCH) != 0;
|
return (mKindAndFlags & KIND_FLAG_EXACT_MATCH) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isExactMatchWithIntentionalOmission() {
|
public boolean isExactMatchWithIntentionalOmission() {
|
||||||
return (mKindAndFlags
|
return (mKindAndFlags & KIND_FLAG_EXACT_MATCH_WITH_INTENTIONAL_OMISSION) != 0;
|
||||||
& SuggestedWordInfo.KIND_FLAG_EXACT_MATCH_WITH_INTENTIONAL_OMISSION) != 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDebugString(final String str) {
|
public void setDebugString(final String str) {
|
||||||
|
|
Loading…
Reference in New Issue