Detect most likely words from text without spaces / combined words
问题 Is there a good library can detect and split words from a combined string? Example: "cdimage" -> ["cd", "image"] "filesaveas" -> ["file", "save", "as"] 回答1: Here's a dynamic programming solution (implemented as a memoized function). Given a dictionary of words with their frequencies, it splits the input text at the positions that give the overall most likely phrase. You'll have to find a real wordlist, but I included some made-up frequencies for a simple test. WORD_FREQUENCIES = { 'file': 0