What is it?
This program is used to return a list of possible items based on the user's input string.
Why?
I really like Chinese tea just as my father. He owns a tea shop called Orijin Tea. I tried to use the official website and found out that the search results were not so accurate. I suddenly realized that I can improve the search functionality.
Brief Methodology
There are two major parts to this system: saving data and retrieving data. The raw data are stored in a 2d python list. I put this data set into a hash table before running through the algorithm. To retrieve the correct product, I take the user input and go through each product. If the user input appears inside the product, then we can print that product for the user (in a specific format).
Current Progress
Right now, the program can quickly handle the whole tea collection at Orijin Tea (approximately 135 types of Chinese Tea). As the user types in a search text, the program suggests a few possible products, including the rating, price, tea origin, and its name.
(The ratings section is not set yet.)
The current data retrieval is good enough for small data. I tested it with 20k sized data set (20k tea data) and the time it iterated through the whole data set was approx. 0.04s.
Next Steps
I am considering to implement this functionality into GUI to visualize it better. Function wise, I am still trying to implement a better algorithm which can handle larger data sets.
If you want to see more details in code, follow on GitHub:
Link
Thank you for reading it through! ^_^
Top comments (0)