@@ -1847,42 +1847,6 @@ void UserHistoryPredictor::Finish(const ConversionRequest &request,
1847
1847
1848
1848
RevertEntries revert_entries;
1849
1849
1850
- // If user inputs a punctuation just after some long sentence,
1851
- // we make a new candidate by concatenating the top element in LRU and
1852
- // the punctuation user input. The top element in LRU is supposed to be
1853
- // the long sentence user input before.
1854
- // This is a fix for http://b/issue?id=2216838
1855
- //
1856
- // Note: We don't make such candidates for mobile.
1857
- if (!request.request ().zero_query_suggestion () && !dic_->empty () &&
1858
- dic_->Head ()->value .last_access_time () + 5 > last_access_time &&
1859
- // Check if the current value is a punctuation.
1860
- segments.conversion_segments_size () == 1 &&
1861
- segments.conversion_segment (0 ).candidates_size () > 0 &&
1862
- IsPunctuation (segments.conversion_segment (0 ).candidate (0 ).value ) &&
1863
- // Check if the previous value looks like a sentence.
1864
- !segments.history_segments ().empty () &&
1865
- segments.history_segments ().back ().candidates_size () > 0 &&
1866
- IsSentenceLikeCandidate (
1867
- segments.history_segments ().back ().candidate (0 ))) {
1868
- const Entry *entry = &(dic_->Head ()->value );
1869
- DCHECK (entry);
1870
- absl::string_view last_value =
1871
- segments.history_segments ().back ().candidate (0 ).value ;
1872
- // Check if the head value in LRU ends with the candidate value in history
1873
- // segments.
1874
- if (entry->value ().ends_with (last_value)) {
1875
- const Segment::Candidate &candidate =
1876
- segments.conversion_segment (0 ).candidate (0 );
1877
- // Uses the same last_access_time stored in the top element
1878
- // so that this item can be grouped together.
1879
- TryInsert (request, absl::StrCat (entry->key (), candidate.key ),
1880
- absl::StrCat (entry->value (), candidate.value ),
1881
- entry->description (), is_suggestion, {},
1882
- entry->last_access_time (), &revert_entries);
1883
- }
1884
- }
1885
-
1886
1850
InsertHistory (request, is_suggestion, last_access_time, segments,
1887
1851
&revert_entries);
1888
1852
0 commit comments