Implement bag-of-words similarity search from scratch | Apple