Buggy code:
private void commitTyped ( InputConnection ic ) { if ( LIMEService . DEBUG ) Log . i ( LIMEService . TAG , "commitTyped()" ) ; try { if ( ( ( mComposing . length ( ) ) > 0 ) || ( ( ( selectedCandidate ) != null ) && ( ! ( selectedCandidate . isComposingCodeRecord ( ) ) ) ) ) { if ( ! ( mEnglishOnly ) ) { if ( ( ( ( selectedCandidate ) != null ) && ( ( selectedCandidate . getWord ( ) ) != null ) ) && ( ! ( selectedCandidate . getWord ( ) . equals ( "" ) ) ) ) { int firstMatchedLength = 1 ; if ( ( ( selectedCandidate . getCode ( ) ) == null ) || ( selectedCandidate . getCode ( ) . equals ( "" ) ) ) { firstMatchedLength = 1 ; } String wordToCommit = selectedCandidate . getWord ( ) ; if ( ( ( ( selectedCandidate ) != null ) && ( ( selectedCandidate . getCode ( ) ) != null ) ) && ( ( selectedCandidate . getWord ( ) ) != null ) ) { if ( selectedCandidate . getCode ( ) . toLowerCase ( Locale . US ) . equals ( selectedCandidate . getWord ( ) . toLowerCase ( Locale . US ) ) ) { firstMatchedLength = 1 ; } } if ( LIMEService . DEBUG ) Log . i ( LIMEService . TAG , ( "commitTyped()<seq2seq4repair_space>committed<seq2seq4repair_space>Length=" + firstMatchedLength ) ) ; if ( ic != null ) ic . commitText ( SearchSrv . hanConvert ( wordToCommit ) , firstMatchedLength ) ; if ( currentSoftKeyboard . contains ( "wb" ) ) { clearComposing ( true ) ; } boolean composingNotFinish = false ; int committedCodeLength = SearchSrv . getRealCodeLength ( selectedCandidate ) ; if ( LIMEService . DEBUG ) Log . i ( LIMEService . TAG , ( "commitTyped():<seq2seq4repair_space>committedCodeLength<seq2seq4repair_space>=<seq2seq4repair_space>" + committedCodeLength ) ) ; if ( ( mComposing . length ( ) ) > ( selectedCandidate . getCode ( ) . length ( ) ) ) { composingNotFinish = true ; } boolean shouldUpdateCandidates = false ; if ( composingNotFinish ) { if ( ( LDComposingBuffer . length ( ) ) == 0 ) { LDComposingBuffer = mComposing . toString ( ) ; if ( LIMEService . DEBUG ) Log . i ( LIMEService . TAG , ( ( ( ( "commitTyped():starting<seq2seq4repair_space>LD<seq2seq4repair_space>process,<seq2seq4repair_space>LDBuffer=" + ( LDComposingBuffer ) ) + ".<seq2seq4repair_space>just<seq2seq4repair_space>committed<seq2seq4repair_space>code=<seq2seq4repair_space>'" ) + ( selectedCandidate . getCode ( ) ) ) + "'" ) ) ; SearchSrv . addLDPhrase ( selectedCandidate , false ) ; } else { if ( LIMEService . DEBUG ) Log . i ( LIMEService . TAG , ( ( ( "commitTyped():Continuous<seq2seq4repair_space>LD<seq2seq4repair_space>process,<seq2seq4repair_space>LDBuffer='" + ( LDComposingBuffer ) ) + "'.<seq2seq4repair_space>just<seq2seq4repair_space>committed<seq2seq4repair_space>code=" ) + ( selectedCandidate . getCode ( ) ) ) ) ; SearchSrv . addLDPhrase ( selectedCandidate , false ) ; } mComposing = mComposing . delete ( 0 , committedCodeLength ) ; if ( LIMEService . DEBUG ) Log . i ( LIMEService . TAG , ( ( ( ( "commitTyped():<seq2seq4repair_space>trimmed<seq2seq4repair_space>mCopmosing<seq2seq4repair_space>=<seq2seq4repair_space>'" + ( mComposing ) ) + "',<seq2seq4repair_space>" ) + "+<seq2seq4repair_space>mComposing.length<seq2seq4repair_space>=<seq2seq4repair_space>" ) + ( mComposing . length ( ) ) ) ) ; if ( ! ( mComposing . toString ( ) . equals ( "<seq2seq4repair_space>" ) ) ) { if ( mComposing . toString ( ) . startsWith ( "<seq2seq4repair_space>" ) ) mComposing = mComposing . deleteCharAt ( 0 ) ; if ( LIMEService . DEBUG ) Log . i ( LIMEService . TAG , ( ( "commitTyped():<seq2seq4repair_space>new<seq2seq4repair_space>mComposing:'" + ( mComposing ) ) + "'" ) ) ; if ( ( mComposing . length ( ) ) > 0 ) { if ( ic != null ) ic . setComposingText ( mComposing , 1 ) ; shouldUpdateCandidates = true ; } } } else { if ( ( LDComposingBuffer . length ( ) ) > 0 ) { if ( LIMEService . DEBUG ) Log . i ( LIMEService . TAG , ( ( ( "commitTyped():Ending<seq2seq4repair_space>LD<seq2seq4repair_space>process,<seq2seq4repair_space>LDBuffer=" + ( LDComposingBuffer ) ) + ".<seq2seq4repair_space>just<seq2seq4repair_space>committed<seq2seq4repair_space>code=" ) + ( selectedCandidate . getCode ( ) ) ) ) ; LDComposingBuffer = "" ; SearchSrv . addLDPhrase ( selectedCandidate , true ) ; } else if ( ( LDComposingBuffer . length ( ) ) > 0 ) { if ( LIMEService . DEBUG ) Log . i ( LIMEService . TAG , ( ( ( "commitTyped():LD<seq2seq4repair_space>process<seq2seq4repair_space>interrupted,<seq2seq4repair_space>LDBuffer=" + ( LDComposingBuffer ) ) + ".<seq2seq4repair_space>just<seq2seq4repair_space>committed<seq2seq4repair_space>code=" ) + ( selectedCandidate . getCode ( ) ) ) ) ; LDComposingBuffer = "" ; SearchSrv . addLDPhrase ( null , true ) ; } } if ( shouldUpdateCandidates ) { updateCandidates ( ) ; } else { committedCandidate = new Mapping ( selectedCandidate ) ; selectedCandidate = null ; clearComposing ( false ) ; <START_BUG> SearchSrv . addUserDictAndUpdateScore ( committedCandidate ) ; <END_BUG> SearchSrv . getCodeListStringFromWord ( committedCandidate . getWord ( ) ) ; updateRelatedPhrase ( false ) ; } } else { if ( ic != null ) ic . commitText ( mComposing , mComposing . length ( ) ) ; } } else { if ( ic != null ) ic . commitText ( mComposing , mComposing . length ( ) ) ; } } } catch ( Exception e ) { e . printStackTrace ( ) ; } } public void updateShiftKeyState ( EditorInfo attr ) { } private boolean isValidLetter ( int code ) { } private boolean isValidDigit ( int code ) { } private boolean isValidSymbol ( int code ) { } private void keyDownUp ( int keyEventCode , boolean sendToSelf ) { } public void onKey ( int primaryCode , int [ ] keyCodes ) { } public void onKey ( int primaryCode , int [ ] keyCodes , int x , int y ) { } private AlertDialog mOptionsDialog ; private static final int POS_SETTINGS = 0 ; private static final int POS_HANCONVERT = 1 ;

Fix:
SearchSrv . learnRelatedPhraseAndUpdateScore ( committedCandidate ) ;