Merge "Update language to comply with Android's inclusive language guidance"

This commit is contained in:
Treehugger Robot 2020-07-31 17:05:33 +00:00 committed by Gerrit Code Review
commit 9490b1b92f
21 changed files with 24 additions and 24 deletions

View File

@ -37,7 +37,7 @@
<!-- Chosen to be slightly less than the "aggressive" threshold. This is the threshold for
a mildly plausible suggestion given the input; if no "plausible" suggestion is present
for a language, it's a strong indicator the user is not typing in this language, so we
may be more forgiving of whitelist entries in another language. -->
may be more forgiving of allowlist entries in another language. -->
<string name="plausibility_threshold" translatable="false">0.065</string>
<!-- The index of the auto correction threshold values array. -->

View File

@ -22,7 +22,7 @@
There is another emoji code point list for JB-MR2 and KLP and later under
res/xml/values-v1[89].-->
<resources>
<!-- Dummy codeArrays for recents emoji keyboard.
<!-- Placeholder codeArrays for recents emoji keyboard.
Do not remove these keys, because they are used as a template. -->
<array
name="emoji_recents"

View File

@ -523,7 +523,7 @@ public final class BinaryDictionaryFileDumper {
}
// Read from metadata file in resources to get the baseline dictionary info.
// This ensures we start with a sane list of available dictionaries.
// This ensures we start with a valid list of available dictionaries.
final int metadataResourceId = context.getResources().getIdentifier("metadata",
"raw", DictionaryInfoUtils.RESOURCE_PACKAGE_NAME);
if (metadataResourceId == 0) {

View File

@ -190,7 +190,7 @@ public class RichInputMethodSubtype {
false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */,
SUBTYPE_ID_OF_PLACEHOLDER_NO_LANGUAGE_SUBTYPE));
// Caveat: We probably should remove this when we add an Emoji subtype in {@link R.xml.method}.
// Dummy Emoji subtype. See {@link R.xml.method}.
// Placeholder Emoji subtype. See {@link R.xml.method}.
private static final int SUBTYPE_ID_OF_PLACEHOLDER_EMOJI_SUBTYPE = 0xd78b2ed0;
private static final String EXTRA_VALUE_OF_PLACEHOLDER_EMOJI_SUBTYPE =
"KeyboardLayoutSet=" + SubtypeLocaleUtils.EMOJI

View File

@ -225,7 +225,7 @@ public final class Suggest {
// TODO: now that we have personalization, we may want to re-evaluate this decision
|| !mDictionaryFacilitator.hasAtLeastOneInitializedMainDictionary()
// If the first suggestion is a shortcut we never auto-correct to it, regardless
// of how strong it is (whitelist entries are not KIND_SHORTCUT but KIND_WHITELIST).
// of how strong it is (allowlist entries are not KIND_SHORTCUT but KIND_WHITELIST).
// TODO: we may want to have shortcut-only entries auto-correct in the future.
|| suggestionResults.first().isKindOf(SuggestedWordInfo.KIND_SHORTCUT)) {
hasAutoCorrection = false;

View File

@ -105,7 +105,7 @@ bool HeaderPolicy::fillInAndWriteHeaderToBuffer(const bool updatesLastDecayedTim
&writingPos)) {
return false;
}
// Temporarily writes a dummy header size.
// Temporarily writes a placeholder header size.
int headerSizeFieldPos = writingPos;
if (!HeaderReadWriteUtils::writeDictionaryHeaderSize(outBuffer, 0 /* size */,
&writingPos)) {

View File

@ -97,7 +97,7 @@ class HeaderPolicy : public DictionaryHeaderStructurePolicy {
headerPolicy->mForgettingCurveProbabilityValuesTableId),
mCodePointTable(headerPolicy->mCodePointTable) {}
// Temporary dummy header.
// Temporary placeholder header.
HeaderPolicy()
: mDictFormatVersion(FormatUtils::UNKNOWN_VERSION), mDictionaryFlags(0), mSize(0),
mAttributeMap(), mLocale(CharUtils::EMPTY_STRING), mMultiWordCostMultiplier(0.0f),

View File

@ -69,7 +69,7 @@ bool ProbabilityDictContent::setProbabilityEntry(const int terminalId,
// Write new entry.
int writingPos = getBuffer()->getTailPosition();
while (writingPos <= entryPos) {
// Fulfilling with dummy entries until writingPos.
// Fulfilling with placeholder entries until writingPos.
if (!writeEntry(&dummyEntry, writingPos)) {
AKLOGE("Cannot write dummy entry. pos: %d, mSize: %d", writingPos, mSize);
return false;

View File

@ -38,7 +38,7 @@ class ProbabilityEntry {
: mFlags(probabilityEntry.mFlags), mProbability(probabilityEntry.mProbability),
mHistoricalInfo(probabilityEntry.mHistoricalInfo) {}
// Dummy entry
// Placeholder entry
ProbabilityEntry()
: mFlags(0), mProbability(NOT_A_PROBABILITY), mHistoricalInfo() {}

View File

@ -339,7 +339,7 @@ bool Ver4PatriciaTrieNodeWriter::writePtNodeAndGetTerminalIdAndAdvancePosition(
const PtNodeParams *const ptNodeParams, int *const outTerminalId,
int *const ptNodeWritingPos) {
const int nodePos = *ptNodeWritingPos;
// Write dummy flags. The Node flags are updated with appropriate flags at the last step of the
// Write placeholder flags. The Node flags are updated with appropriate flags at the last step of the
// PtNode writing.
if (!DynamicPtWritingUtils::writeFlagsAndAdvancePosition(mTrieBuffer,
0 /* nodeFlags */, ptNodeWritingPos)) {

View File

@ -76,14 +76,14 @@ bool DynamicPtGcEventListeners::TraversePolicyToUpdateBigramProbability
return true;
}
// Writes dummy PtNode array size when the head of PtNode array is read.
// Writes placeholder PtNode array size when the head of PtNode array is read.
bool DynamicPtGcEventListeners::TraversePolicyToPlaceAndWriteValidPtNodesToBuffer
::onDescend(const int ptNodeArrayPos) {
mValidPtNodeCount = 0;
int writingPos = mBufferToWrite->getTailPosition();
mDictPositionRelocationMap->mPtNodeArrayPositionRelocationMap.insert(
PtNodeWriter::PtNodeArrayPositionRelocationMap::value_type(ptNodeArrayPos, writingPos));
// Writes dummy PtNode array size because arrays can have a forward link or needles PtNodes.
// Writes placeholder PtNode array size because arrays can have a forward link or needles PtNodes.
// This field will be updated later in onReadingPtNodeArrayTail() with actual PtNode count.
mPtNodeArraySizeFieldPos = writingPos;
return DynamicPtWritingUtils::writePtNodeArraySizeAndAdvancePosition(

View File

@ -27,7 +27,7 @@ const ShortcutListReadingUtils::ShortcutFlags
const ShortcutListReadingUtils::ShortcutFlags
ShortcutListReadingUtils::MASK_ATTRIBUTE_PROBABILITY = 0x0F;
const int ShortcutListReadingUtils::SHORTCUT_LIST_SIZE_FIELD_SIZE = 2;
// The numeric value of the shortcut probability that means 'whitelist'.
// The numeric value of the shortcut probability that means 'allowlist'.
const int ShortcutListReadingUtils::WHITELIST_SHORTCUT_PROBABILITY = 15;
/* static */ ShortcutListReadingUtils::ShortcutFlags

View File

@ -34,7 +34,7 @@ class ProbabilityEntry {
: mFlags(probabilityEntry.mFlags), mProbability(probabilityEntry.mProbability),
mHistoricalInfo(probabilityEntry.mHistoricalInfo) {}
// Dummy entry
// Placeholder entry
ProbabilityEntry()
: mFlags(Ver4DictConstants::FLAG_NOT_A_VALID_ENTRY), mProbability(NOT_A_PROBABILITY),
mHistoricalInfo() {}

View File

@ -286,7 +286,7 @@ bool Ver4PatriciaTrieNodeWriter::writePtNodeAndGetTerminalIdAndAdvancePosition(
const PtNodeParams *const ptNodeParams, int *const outTerminalId,
int *const ptNodeWritingPos) {
const int nodePos = *ptNodeWritingPos;
// Write dummy flags. The Node flags are updated with appropriate flags at the last step of the
// Write placeholder flags. The Node flags are updated with appropriate flags at the last step of the
// PtNode writing.
if (!DynamicPtWritingUtils::writeFlagsAndAdvancePosition(mTrieBuffer,
0 /* nodeFlags */, ptNodeWritingPos)) {

View File

@ -41,7 +41,7 @@ class BinaryDictionaryShortcutIterator {
}
// Gets the shortcut target itself as an int string and put it to outTarget, put its length
// to outTargetLength, put whether it is whitelist to outIsWhitelist.
// to outTargetLength, put whether it is allowlist to outIsWhitelist.
AK_FORCE_INLINE void nextShortcutTarget(
const int maxDepth, int *const outTarget, int *const outTargetLength,
bool *const outIsWhitelist) {

View File

@ -1,3 +1,3 @@
/* This dummy raw resource is needed to be able to load string resources from a test APK
/* This placeholder raw resource is needed to be able to load string resources from a test APK
* successfully. (See {@link KeySpecParserSplitTests#setUp()}.
*/

View File

@ -51,7 +51,7 @@ public class SuggestionSpanUtilsTest {
}
/**
* Helper method to create a dummy {@link SuggestedWordInfo}.
* Helper method to create a placeholder {@link SuggestedWordInfo}.
*
* @param kindAndFlags the kind and flags to be used to create {@link SuggestedWordInfo}.
* @param word the word to be used to create {@link SuggestedWordInfo}.

View File

@ -36,7 +36,7 @@ import java.util.Locale;
public class SuggestedWordsTests {
/**
* Helper method to create a dummy {@link SuggestedWordInfo} with specifying
* Helper method to create a placeholder {@link SuggestedWordInfo} with specifying
* {@link SuggestedWordInfo#KIND_TYPED}.
*
* @param word the word to be used to create {@link SuggestedWordInfo}.
@ -53,7 +53,7 @@ public class SuggestedWordsTests {
}
/**
* Helper method to create a dummy {@link SuggestedWordInfo} with specifying
* Helper method to create a placeholder {@link SuggestedWordInfo} with specifying
* {@link SuggestedWordInfo#KIND_CORRECTION}.
*
* @param word the word to be used to create {@link SuggestedWordInfo}.

View File

@ -446,7 +446,7 @@ public class BinaryDictEncoderUtils {
}
/**
* Sanity-checking method.
* Validity-checking method.
*
* This method checks a list of PtNode arrays for juxtaposition, that is, it will do
* nothing if each node array's cached address is actually the previous node array's address
@ -664,7 +664,7 @@ public class BinaryDictEncoderUtils {
+ "of the node : " + dictEncoder.getPosition() + " <> "
+ ptNode.mCachedAddressAfterUpdate);
}
// Sanity checks.
// Validity checks.
if (DBG && ptNode.getProbability() > FormatSpec.MAX_TERMINAL_FREQUENCY) {
throw new RuntimeException("A node has a frequency > "
+ FormatSpec.MAX_TERMINAL_FREQUENCY

View File

@ -277,7 +277,7 @@ public final class FusionDictionary implements Iterable<WordProperty> {
}
/**
* Sanity check for a PtNode array.
* Validity check for a PtNode array.
*
* This method checks that all PtNodes in a node array are ordered as expected.
* If they are, nothing happens. If they aren't, an exception is thrown.

View File

@ -37,7 +37,7 @@ import java.util.Random;
public class UserHistoryDictionaryTestsHelper {
/**
* Locale prefix for generating dummy locales for tests.
* Locale prefix for generating placeholder locales for tests.
*/
public static final String TEST_LOCALE_PREFIX = "test-";