Methods Summary |
---|
public void | addSample(java.lang.String sampleName)
if (!retrievePredictor())
throw new RuntimeException(PREDICTOR_NOTAVAILABLE);
try {
mPredictor.pushNewSample(sampleName);
} catch (RemoteException e) {
Log.e(TAG,"Exception: pushing a new example");
throw new RuntimeException(PREDICTOR_NOTAVAILABLE);
}
|
public java.util.ArrayList | getTopSamples()
return getTopSamples(0);
|
public java.util.ArrayList | getTopSamples(int topK)
try {
ArrayList<StringFloat> topList =
(ArrayList<StringFloat>) mPredictor.getTopCandidates(topK);
ArrayList<Pair<String, Float> > topSamples =
new ArrayList<Pair<String, Float> >(topList.size());
for (int i = 0; i < topList.size(); ++i) {
topSamples.add(new Pair<String, Float>(topList.get(i).key, topList.get(i).value));
}
return topSamples;
} catch(RemoteException e) {
Log.e(TAG,"Exception: getTopSamples");
throw new RuntimeException(PREDICTOR_NOTAVAILABLE);
}
|
public boolean | reset()
if (!retrievePredictor()){
Log.e(TAG, "reset: " + PREDICTOR_NOTAVAILABLE);
return false;
}
try {
mPredictor.resetPredictor();
return true;
} catch (RemoteException e) {
}
return false;
|
public boolean | retrievePredictor()
if (mPredictor == null) {
mPredictor = BordeauxManagerService.getPredictor(mContext, mName);
}
if (mPredictor == null) {
Log.e(TAG, "retrievePredictor: " + PREDICTOR_NOTAVAILABLE);
return false;
}
return true;
|
public boolean | setParameter(java.lang.String key, java.lang.String value)
if (!retrievePredictor())
throw new RuntimeException(PREDICTOR_NOTAVAILABLE);
try {
return mPredictor.setPredictorParameter(key, value);
} catch (RemoteException e) {
Log.e(TAG,"Exception: setting predictor parameter");
throw new RuntimeException(PREDICTOR_NOTAVAILABLE);
}
|