app/src/main/java/com/voices/ui/activity/HomeActivity.java
/**
     * Method used to check whether the spoken word(s) is present in the dictionary or not
     *
     * @param speechText
     */
Method used to check whether the spoken word(s) is present in the dictionary or not
@param speechText
Method used to check whether the spoken word ( s ) is present in the dictionary or not @param speechText
private void checkWordInDictionary(String speechText) {
        if (dictionaryArray != null) {
            updatedPositions = dictionary.getDictionaryMatchPosition(speechText);
            for (int i = 0; i < dictionaryArray.size(); i++) {
                dictionaryArray.get(i).setUpdated(false);
            }
            Iterator positionIterator = updatedPositions.keySet().iterator();
            while (positionIterator.hasNext()) {
                int key = (int) positionIterator.next();
                int value = updatedPositions.get(key);
                dictionaryArray.get(value).setUpdated(true);
            }
            dictionaryListAdapter.refreshAdapter(dictionaryArray);
            hideProgress();
            if (updatedPositions.isEmpty())
                AppUtils.showToast(this, getString(R.string.error_no_matching_word));
        } else
            AppUtils.showToast(this, getString(R.string.error_something_went_wrong));
    }
private void checkWordInDictionary ( String speechText ) { if ( dictionaryArray != null ) { updatedPositions = dictionary . getDictionaryMatchPosition ( speechText ) ; for ( int i = 0 ; i < dictionaryArray . size ( ) ; i ++ ) { dictionaryArray . get ( i ) . setUpdated ( false ) ; } Iterator positionIterator = updatedPositions . keySet ( ) . iterator ( ) ; while ( positionIterator . hasNext ( ) ) { int key = ( int ) positionIterator . next ( ) ; int value = updatedPositions . get ( key ) ; dictionaryArray . get ( value ) . setUpdated ( true ) ; } dictionaryListAdapter . refreshAdapter ( dictionaryArray ) ; hideProgress ( ) ; if ( updatedPositions . isEmpty ( ) ) AppUtils . showToast ( this , getString ( R . string . error_no_matching_word ) ) ; } else AppUtils . showToast ( this , getString ( R . string . error_something_went_wrong ) ) ; }
Method used to check whether the spoken word(s) is present in the dictionary or not
 @param speechText
Method used to check whether the spoken word ( s ) is present in the dictionary or not @param speechText
//Clear All status Update Value in the list //Push the status whether the item is updated or not //Check if the word(s) is not present in the dictionary