Unicode input: When searching by name search for prefix matches as well as whole word matches

So now hori matches both "hori" and "horizontal". Switched to a
prefix-trie internally.
This commit is contained in:
Kovid Goyal
2018-04-24 07:45:20 +05:30
parent 9d67198ff9
commit 0b99bb534f
9 changed files with 32513 additions and 30796 deletions

View File

@@ -56,7 +56,7 @@ def name(cp):
@lru_cache(maxsize=256)
def codepoints_matching_search(parts):
ans = []
if parts and parts[0]:
if parts and parts[0] and len(parts[0]) > 1:
codepoints = points_for_word(parts[0])
for word in parts[1:]:
pts = points_for_word(word)