Products classification by name
If you have enough data and reasonable number of classes, you can definitely train your model. The grouping of words that you have done is similar to an approach called bag-of-words model. You can use that to build a classifier using Naive Bayes or SVM etc. 
On a different note, you can also look at the KNN algorithm because it looks fit for your use case. You can have a look at this paper