Remove warnings
Thanks Eclipse Change-Id: I88e3979ed22be5d8be5a5accdde417c6b1a8bf2dmain
parent
74d66a5513
commit
f41389a74b
|
@ -565,6 +565,7 @@ public final class BinaryDictIOUtils {
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private static void updateForwardLink(final FusionDictionaryBufferInterface buffer,
|
private static void updateForwardLink(final FusionDictionaryBufferInterface buffer,
|
||||||
final int nodeOriginAddress, final int newNodeAddress,
|
final int nodeOriginAddress, final int newNodeAddress,
|
||||||
final FormatOptions formatOptions) {
|
final FormatOptions formatOptions) {
|
||||||
|
|
|
@ -77,12 +77,12 @@ public final class BinaryDictInputOutput {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int readUnsignedByte() {
|
public int readUnsignedByte() {
|
||||||
return ((int)mBuffer.get()) & 0xFF;
|
return mBuffer.get() & 0xFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int readUnsignedShort() {
|
public int readUnsignedShort() {
|
||||||
return ((int)mBuffer.getShort()) & 0xFFFF;
|
return mBuffer.getShort() & 0xFFFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -474,11 +474,8 @@ public final class BinaryDictInputOutput {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final int SINT8_MAX = 0x7F;
|
|
||||||
private static final int SINT16_MAX = 0x7FFF;
|
|
||||||
private static final int SINT24_MAX = 0x7FFFFF;
|
private static final int SINT24_MAX = 0x7FFFFF;
|
||||||
private static final int MSB8 = 0x80;
|
private static final int MSB8 = 0x80;
|
||||||
private static final int MSB16 = 0x8000;
|
|
||||||
private static final int MSB24 = 0x800000;
|
private static final int MSB24 = 0x800000;
|
||||||
|
|
||||||
// End utility methods.
|
// End utility methods.
|
||||||
|
@ -1711,7 +1708,7 @@ public final class BinaryDictInputOutput {
|
||||||
*
|
*
|
||||||
* Concretely this only tests the magic number.
|
* Concretely this only tests the magic number.
|
||||||
*
|
*
|
||||||
* @param filename The name of the file to test.
|
* @param file The file to test.
|
||||||
* @return true if it's a binary dictionary, false otherwise
|
* @return true if it's a binary dictionary, false otherwise
|
||||||
*/
|
*/
|
||||||
public static boolean isBinaryDictionary(final File file) {
|
public static boolean isBinaryDictionary(final File file) {
|
||||||
|
@ -1751,8 +1748,7 @@ public final class BinaryDictInputOutput {
|
||||||
final int bigramFrequency) {
|
final int bigramFrequency) {
|
||||||
final float stepSize = (FormatSpec.MAX_TERMINAL_FREQUENCY - unigramFrequency)
|
final float stepSize = (FormatSpec.MAX_TERMINAL_FREQUENCY - unigramFrequency)
|
||||||
/ (1.5f + FormatSpec.MAX_BIGRAM_FREQUENCY);
|
/ (1.5f + FormatSpec.MAX_BIGRAM_FREQUENCY);
|
||||||
final float resultFreqFloat = (float)unigramFrequency
|
final float resultFreqFloat = unigramFrequency + stepSize * (bigramFrequency + 1.0f);
|
||||||
+ stepSize * (bigramFrequency + 1.0f);
|
|
||||||
return (int)resultFreqFloat;
|
return (int)resultFreqFloat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
|
|
||||||
package com.android.inputmethod.latin.makedict;
|
package com.android.inputmethod.latin.makedict;
|
||||||
|
|
||||||
import com.android.inputmethod.annotations.UsedForTesting;
|
|
||||||
import com.android.inputmethod.latin.Constants;
|
import com.android.inputmethod.latin.Constants;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -158,16 +157,15 @@ public final class FusionDictionary implements Iterable<Word> {
|
||||||
public ArrayList<WeightedString> getShortcutTargets() {
|
public ArrayList<WeightedString> getShortcutTargets() {
|
||||||
// We don't want write permission to escape outside the package, so we return a copy
|
// We don't want write permission to escape outside the package, so we return a copy
|
||||||
if (null == mShortcutTargets) return null;
|
if (null == mShortcutTargets) return null;
|
||||||
final ArrayList<WeightedString> copyOfShortcutTargets = new ArrayList<WeightedString>();
|
final ArrayList<WeightedString> copyOfShortcutTargets =
|
||||||
copyOfShortcutTargets.addAll(mShortcutTargets);
|
new ArrayList<WeightedString>(mShortcutTargets);
|
||||||
return copyOfShortcutTargets;
|
return copyOfShortcutTargets;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ArrayList<WeightedString> getBigrams() {
|
public ArrayList<WeightedString> getBigrams() {
|
||||||
// We don't want write permission to escape outside the package, so we return a copy
|
// We don't want write permission to escape outside the package, so we return a copy
|
||||||
if (null == mBigrams) return null;
|
if (null == mBigrams) return null;
|
||||||
final ArrayList<WeightedString> copyOfBigrams = new ArrayList<WeightedString>();
|
final ArrayList<WeightedString> copyOfBigrams = new ArrayList<WeightedString>(mBigrams);
|
||||||
copyOfBigrams.addAll(mBigrams);
|
|
||||||
return copyOfBigrams;
|
return copyOfBigrams;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
package com.android.inputmethod.latin.dicttool;
|
package com.android.inputmethod.latin.dicttool;
|
||||||
|
|
||||||
import com.android.inputmethod.latin.makedict.BinaryDictInputOutput;
|
import com.android.inputmethod.latin.makedict.BinaryDictInputOutput;
|
||||||
import com.android.inputmethod.latin.makedict.BinaryDictInputOutput.ByteBufferWrapper;
|
|
||||||
import com.android.inputmethod.latin.makedict.FusionDictionary;
|
import com.android.inputmethod.latin.makedict.FusionDictionary;
|
||||||
import com.android.inputmethod.latin.makedict.UnsupportedFormatException;
|
import com.android.inputmethod.latin.makedict.UnsupportedFormatException;
|
||||||
|
|
||||||
|
@ -33,7 +32,6 @@ import java.io.InputStream;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
import java.nio.channels.FileChannel;
|
import java.nio.channels.FileChannel;
|
||||||
import java.nio.channels.FileChannel.MapMode;
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
|
|
|
@ -95,7 +95,7 @@ public class Diff extends Dicttool.Command {
|
||||||
+ dict1.mOptions.mGermanUmlautProcessing);
|
+ dict1.mOptions.mGermanUmlautProcessing);
|
||||||
}
|
}
|
||||||
final HashMap<String, String> options1 =
|
final HashMap<String, String> options1 =
|
||||||
(HashMap<String, String>)dict1.mOptions.mAttributes.clone();
|
new HashMap<String, String>(dict1.mOptions.mAttributes);
|
||||||
for (final String optionKey : dict0.mOptions.mAttributes.keySet()) {
|
for (final String optionKey : dict0.mOptions.mAttributes.keySet()) {
|
||||||
if (!dict0.mOptions.mAttributes.get(optionKey).equals(
|
if (!dict0.mOptions.mAttributes.get(optionKey).equals(
|
||||||
dict1.mOptions.mAttributes.get(optionKey))) {
|
dict1.mOptions.mAttributes.get(optionKey))) {
|
||||||
|
@ -112,7 +112,7 @@ public class Diff extends Dicttool.Command {
|
||||||
|
|
||||||
private static void diffWords(final FusionDictionary dict0, final FusionDictionary dict1) {
|
private static void diffWords(final FusionDictionary dict0, final FusionDictionary dict1) {
|
||||||
for (final Word word0 : dict0) {
|
for (final Word word0 : dict0) {
|
||||||
final CharGroup word1 = dict1.findWordInTree(dict1.mRoot, word0.mWord);
|
final CharGroup word1 = FusionDictionary.findWordInTree(dict1.mRoot, word0.mWord);
|
||||||
if (null == word1) {
|
if (null == word1) {
|
||||||
// This word is not in dict1
|
// This word is not in dict1
|
||||||
System.out.println("Deleted: " + word0.mWord + " " + word0.mFrequency);
|
System.out.println("Deleted: " + word0.mWord + " " + word0.mFrequency);
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class Info extends Dicttool.Command {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void showWordInfo(final FusionDictionary dict, final String word) {
|
private static void showWordInfo(final FusionDictionary dict, final String word) {
|
||||||
final CharGroup group = dict.findWordInTree(dict.mRoot, word);
|
final CharGroup group = FusionDictionary.findWordInTree(dict.mRoot, word);
|
||||||
if (null == group) {
|
if (null == group) {
|
||||||
System.out.println(word + " is not in the dictionary");
|
System.out.println(word + " is not in the dictionary");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue