nusCS2113-AY1920S1 / pe-dev-response

0 stars 0 forks source link

Search begin does not work for certain items #1200

Open nus-pe-bot opened 4 years ago

nus-pe-bot commented 4 years ago

Steps taken: 1) Add 'waffle' and 'whale' to word list 2) search_begin both using various combinations: "w", "wh", "wa" 3) waffle works but whale doesn't.

image.png


[original: nusCS2113-AY1920S1/pe-interim#1200]

tran-quang-thanh commented 4 years ago

Team's Response

This is the bug of this feature. WordBank use Java TreeMap to stored words so it is easy to search prefix of words. When user uses search_begin, WordBank will take all words by calling subMap method of Java Map. The issue may come from the usage of subMap, which doesn't include the last item when calling method.

Duplicate status (if any):

--