mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Update language to comply with Android's inclusive language guidance
See https://source.android.com/setup/contribute/respectful-code for reference Bug: 161896447 Change-Id: I171bc299e660f96f20041a67a3052bd8a2ed781c
This commit is contained in:
parent
4eb192212f
commit
1d9bf42009
@ -37,7 +37,7 @@
|
|||||||
<!-- Chosen to be slightly less than the "aggressive" threshold. This is the threshold for
|
<!-- 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
|
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
|
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>
|
<string name="plausibility_threshold" translatable="false">0.065</string>
|
||||||
|
|
||||||
<!-- The index of the auto correction threshold values array. -->
|
<!-- The index of the auto correction threshold values array. -->
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
There is another emoji code point list for JB-MR2 and KLP and later under
|
There is another emoji code point list for JB-MR2 and KLP and later under
|
||||||
res/xml/values-v1[89].-->
|
res/xml/values-v1[89].-->
|
||||||
<resources>
|
<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. -->
|
Do not remove these keys, because they are used as a template. -->
|
||||||
<array
|
<array
|
||||||
name="emoji_recents"
|
name="emoji_recents"
|
||||||
|
@ -523,7 +523,7 @@ public final class BinaryDictionaryFileDumper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Read from metadata file in resources to get the baseline dictionary info.
|
// 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",
|
final int metadataResourceId = context.getResources().getIdentifier("metadata",
|
||||||
"raw", DictionaryInfoUtils.RESOURCE_PACKAGE_NAME);
|
"raw", DictionaryInfoUtils.RESOURCE_PACKAGE_NAME);
|
||||||
if (metadataResourceId == 0) {
|
if (metadataResourceId == 0) {
|
||||||
|
@ -190,7 +190,7 @@ public class RichInputMethodSubtype {
|
|||||||
false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */,
|
false /* isAuxiliary */, false /* overridesImplicitlyEnabledSubtype */,
|
||||||
SUBTYPE_ID_OF_PLACEHOLDER_NO_LANGUAGE_SUBTYPE));
|
SUBTYPE_ID_OF_PLACEHOLDER_NO_LANGUAGE_SUBTYPE));
|
||||||
// Caveat: We probably should remove this when we add an Emoji subtype in {@link R.xml.method}.
|
// 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 int SUBTYPE_ID_OF_PLACEHOLDER_EMOJI_SUBTYPE = 0xd78b2ed0;
|
||||||
private static final String EXTRA_VALUE_OF_PLACEHOLDER_EMOJI_SUBTYPE =
|
private static final String EXTRA_VALUE_OF_PLACEHOLDER_EMOJI_SUBTYPE =
|
||||||
"KeyboardLayoutSet=" + SubtypeLocaleUtils.EMOJI
|
"KeyboardLayoutSet=" + SubtypeLocaleUtils.EMOJI
|
||||||
|
@ -225,7 +225,7 @@ public final class Suggest {
|
|||||||
// TODO: now that we have personalization, we may want to re-evaluate this decision
|
// TODO: now that we have personalization, we may want to re-evaluate this decision
|
||||||
|| !mDictionaryFacilitator.hasAtLeastOneInitializedMainDictionary()
|
|| !mDictionaryFacilitator.hasAtLeastOneInitializedMainDictionary()
|
||||||
// If the first suggestion is a shortcut we never auto-correct to it, regardless
|
// 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.
|
// TODO: we may want to have shortcut-only entries auto-correct in the future.
|
||||||
|| suggestionResults.first().isKindOf(SuggestedWordInfo.KIND_SHORTCUT)) {
|
|| suggestionResults.first().isKindOf(SuggestedWordInfo.KIND_SHORTCUT)) {
|
||||||
hasAutoCorrection = false;
|
hasAutoCorrection = false;
|
||||||
|
@ -105,7 +105,7 @@ bool HeaderPolicy::fillInAndWriteHeaderToBuffer(const bool updatesLastDecayedTim
|
|||||||
&writingPos)) {
|
&writingPos)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Temporarily writes a dummy header size.
|
// Temporarily writes a placeholder header size.
|
||||||
int headerSizeFieldPos = writingPos;
|
int headerSizeFieldPos = writingPos;
|
||||||
if (!HeaderReadWriteUtils::writeDictionaryHeaderSize(outBuffer, 0 /* size */,
|
if (!HeaderReadWriteUtils::writeDictionaryHeaderSize(outBuffer, 0 /* size */,
|
||||||
&writingPos)) {
|
&writingPos)) {
|
||||||
|
@ -97,7 +97,7 @@ class HeaderPolicy : public DictionaryHeaderStructurePolicy {
|
|||||||
headerPolicy->mForgettingCurveProbabilityValuesTableId),
|
headerPolicy->mForgettingCurveProbabilityValuesTableId),
|
||||||
mCodePointTable(headerPolicy->mCodePointTable) {}
|
mCodePointTable(headerPolicy->mCodePointTable) {}
|
||||||
|
|
||||||
// Temporary dummy header.
|
// Temporary placeholder header.
|
||||||
HeaderPolicy()
|
HeaderPolicy()
|
||||||
: mDictFormatVersion(FormatUtils::UNKNOWN_VERSION), mDictionaryFlags(0), mSize(0),
|
: mDictFormatVersion(FormatUtils::UNKNOWN_VERSION), mDictionaryFlags(0), mSize(0),
|
||||||
mAttributeMap(), mLocale(CharUtils::EMPTY_STRING), mMultiWordCostMultiplier(0.0f),
|
mAttributeMap(), mLocale(CharUtils::EMPTY_STRING), mMultiWordCostMultiplier(0.0f),
|
||||||
|
@ -69,7 +69,7 @@ bool ProbabilityDictContent::setProbabilityEntry(const int terminalId,
|
|||||||
// Write new entry.
|
// Write new entry.
|
||||||
int writingPos = getBuffer()->getTailPosition();
|
int writingPos = getBuffer()->getTailPosition();
|
||||||
while (writingPos <= entryPos) {
|
while (writingPos <= entryPos) {
|
||||||
// Fulfilling with dummy entries until writingPos.
|
// Fulfilling with placeholder entries until writingPos.
|
||||||
if (!writeEntry(&dummyEntry, writingPos)) {
|
if (!writeEntry(&dummyEntry, writingPos)) {
|
||||||
AKLOGE("Cannot write dummy entry. pos: %d, mSize: %d", writingPos, mSize);
|
AKLOGE("Cannot write dummy entry. pos: %d, mSize: %d", writingPos, mSize);
|
||||||
return false;
|
return false;
|
||||||
|
@ -38,7 +38,7 @@ class ProbabilityEntry {
|
|||||||
: mFlags(probabilityEntry.mFlags), mProbability(probabilityEntry.mProbability),
|
: mFlags(probabilityEntry.mFlags), mProbability(probabilityEntry.mProbability),
|
||||||
mHistoricalInfo(probabilityEntry.mHistoricalInfo) {}
|
mHistoricalInfo(probabilityEntry.mHistoricalInfo) {}
|
||||||
|
|
||||||
// Dummy entry
|
// Placeholder entry
|
||||||
ProbabilityEntry()
|
ProbabilityEntry()
|
||||||
: mFlags(0), mProbability(NOT_A_PROBABILITY), mHistoricalInfo() {}
|
: mFlags(0), mProbability(NOT_A_PROBABILITY), mHistoricalInfo() {}
|
||||||
|
|
||||||
|
@ -339,7 +339,7 @@ bool Ver4PatriciaTrieNodeWriter::writePtNodeAndGetTerminalIdAndAdvancePosition(
|
|||||||
const PtNodeParams *const ptNodeParams, int *const outTerminalId,
|
const PtNodeParams *const ptNodeParams, int *const outTerminalId,
|
||||||
int *const ptNodeWritingPos) {
|
int *const ptNodeWritingPos) {
|
||||||
const int nodePos = *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.
|
// PtNode writing.
|
||||||
if (!DynamicPtWritingUtils::writeFlagsAndAdvancePosition(mTrieBuffer,
|
if (!DynamicPtWritingUtils::writeFlagsAndAdvancePosition(mTrieBuffer,
|
||||||
0 /* nodeFlags */, ptNodeWritingPos)) {
|
0 /* nodeFlags */, ptNodeWritingPos)) {
|
||||||
|
@ -76,14 +76,14 @@ bool DynamicPtGcEventListeners::TraversePolicyToUpdateBigramProbability
|
|||||||
return true;
|
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
|
bool DynamicPtGcEventListeners::TraversePolicyToPlaceAndWriteValidPtNodesToBuffer
|
||||||
::onDescend(const int ptNodeArrayPos) {
|
::onDescend(const int ptNodeArrayPos) {
|
||||||
mValidPtNodeCount = 0;
|
mValidPtNodeCount = 0;
|
||||||
int writingPos = mBufferToWrite->getTailPosition();
|
int writingPos = mBufferToWrite->getTailPosition();
|
||||||
mDictPositionRelocationMap->mPtNodeArrayPositionRelocationMap.insert(
|
mDictPositionRelocationMap->mPtNodeArrayPositionRelocationMap.insert(
|
||||||
PtNodeWriter::PtNodeArrayPositionRelocationMap::value_type(ptNodeArrayPos, writingPos));
|
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.
|
// This field will be updated later in onReadingPtNodeArrayTail() with actual PtNode count.
|
||||||
mPtNodeArraySizeFieldPos = writingPos;
|
mPtNodeArraySizeFieldPos = writingPos;
|
||||||
return DynamicPtWritingUtils::writePtNodeArraySizeAndAdvancePosition(
|
return DynamicPtWritingUtils::writePtNodeArraySizeAndAdvancePosition(
|
||||||
|
@ -27,7 +27,7 @@ const ShortcutListReadingUtils::ShortcutFlags
|
|||||||
const ShortcutListReadingUtils::ShortcutFlags
|
const ShortcutListReadingUtils::ShortcutFlags
|
||||||
ShortcutListReadingUtils::MASK_ATTRIBUTE_PROBABILITY = 0x0F;
|
ShortcutListReadingUtils::MASK_ATTRIBUTE_PROBABILITY = 0x0F;
|
||||||
const int ShortcutListReadingUtils::SHORTCUT_LIST_SIZE_FIELD_SIZE = 2;
|
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;
|
const int ShortcutListReadingUtils::WHITELIST_SHORTCUT_PROBABILITY = 15;
|
||||||
|
|
||||||
/* static */ ShortcutListReadingUtils::ShortcutFlags
|
/* static */ ShortcutListReadingUtils::ShortcutFlags
|
||||||
|
@ -34,7 +34,7 @@ class ProbabilityEntry {
|
|||||||
: mFlags(probabilityEntry.mFlags), mProbability(probabilityEntry.mProbability),
|
: mFlags(probabilityEntry.mFlags), mProbability(probabilityEntry.mProbability),
|
||||||
mHistoricalInfo(probabilityEntry.mHistoricalInfo) {}
|
mHistoricalInfo(probabilityEntry.mHistoricalInfo) {}
|
||||||
|
|
||||||
// Dummy entry
|
// Placeholder entry
|
||||||
ProbabilityEntry()
|
ProbabilityEntry()
|
||||||
: mFlags(Ver4DictConstants::FLAG_NOT_A_VALID_ENTRY), mProbability(NOT_A_PROBABILITY),
|
: mFlags(Ver4DictConstants::FLAG_NOT_A_VALID_ENTRY), mProbability(NOT_A_PROBABILITY),
|
||||||
mHistoricalInfo() {}
|
mHistoricalInfo() {}
|
||||||
|
@ -286,7 +286,7 @@ bool Ver4PatriciaTrieNodeWriter::writePtNodeAndGetTerminalIdAndAdvancePosition(
|
|||||||
const PtNodeParams *const ptNodeParams, int *const outTerminalId,
|
const PtNodeParams *const ptNodeParams, int *const outTerminalId,
|
||||||
int *const ptNodeWritingPos) {
|
int *const ptNodeWritingPos) {
|
||||||
const int nodePos = *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.
|
// PtNode writing.
|
||||||
if (!DynamicPtWritingUtils::writeFlagsAndAdvancePosition(mTrieBuffer,
|
if (!DynamicPtWritingUtils::writeFlagsAndAdvancePosition(mTrieBuffer,
|
||||||
0 /* nodeFlags */, ptNodeWritingPos)) {
|
0 /* nodeFlags */, ptNodeWritingPos)) {
|
||||||
|
@ -41,7 +41,7 @@ class BinaryDictionaryShortcutIterator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Gets the shortcut target itself as an int string and put it to outTarget, put its length
|
// 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(
|
AK_FORCE_INLINE void nextShortcutTarget(
|
||||||
const int maxDepth, int *const outTarget, int *const outTargetLength,
|
const int maxDepth, int *const outTarget, int *const outTargetLength,
|
||||||
bool *const outIsWhitelist) {
|
bool *const outIsWhitelist) {
|
||||||
|
@ -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()}.
|
* successfully. (See {@link KeySpecParserSplitTests#setUp()}.
|
||||||
*/
|
*/
|
||||||
|
@ -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 kindAndFlags the kind and flags to be used to create {@link SuggestedWordInfo}.
|
||||||
* @param word the word to be used to create {@link SuggestedWordInfo}.
|
* @param word the word to be used to create {@link SuggestedWordInfo}.
|
||||||
|
@ -36,7 +36,7 @@ import java.util.Locale;
|
|||||||
public class SuggestedWordsTests {
|
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}.
|
* {@link SuggestedWordInfo#KIND_TYPED}.
|
||||||
*
|
*
|
||||||
* @param word the word to be used to create {@link SuggestedWordInfo}.
|
* @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}.
|
* {@link SuggestedWordInfo#KIND_CORRECTION}.
|
||||||
*
|
*
|
||||||
* @param word the word to be used to create {@link SuggestedWordInfo}.
|
* @param word the word to be used to create {@link SuggestedWordInfo}.
|
||||||
|
@ -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
|
* 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
|
* 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() + " <> "
|
+ "of the node : " + dictEncoder.getPosition() + " <> "
|
||||||
+ ptNode.mCachedAddressAfterUpdate);
|
+ ptNode.mCachedAddressAfterUpdate);
|
||||||
}
|
}
|
||||||
// Sanity checks.
|
// Validity checks.
|
||||||
if (DBG && ptNode.getProbability() > FormatSpec.MAX_TERMINAL_FREQUENCY) {
|
if (DBG && ptNode.getProbability() > FormatSpec.MAX_TERMINAL_FREQUENCY) {
|
||||||
throw new RuntimeException("A node has a frequency > "
|
throw new RuntimeException("A node has a frequency > "
|
||||||
+ FormatSpec.MAX_TERMINAL_FREQUENCY
|
+ FormatSpec.MAX_TERMINAL_FREQUENCY
|
||||||
|
@ -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.
|
* 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.
|
* If they are, nothing happens. If they aren't, an exception is thrown.
|
||||||
|
@ -37,7 +37,7 @@ import java.util.Random;
|
|||||||
public class UserHistoryDictionaryTestsHelper {
|
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-";
|
public static final String TEST_LOCALE_PREFIX = "test-";
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user