8000 Casing issue with synonyms · Issue #35 · seperman/fast-autocomplete · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000
Casing issue with synonyms #35
Open
@iaudouard

Description

@iaudouard

Hi there,
I have encountered a bug that occurs when the synonym key includes uppercase characters.
I use the autocomplete for shows' titles, which have uppercase characters. The problem is that if I run the program below, nothing is returned as an autocomplete suggestion

def autocomplete(query, x):
    valid_chars = string.ascii_letters
    words = {
        'Attack on Titan': {}
    }
    synonyms = {

        "Attack on Titan": ["Shingeki no Kyojin", "AOT"],

    }
    autocomplete = AutoComplete(
        words=words, synonyms=synonyms, valid_chars_for_string=valid_chars)
    return autocomplete.search(word=query, size=x)


print(autocomplete('Shin', 5))

However if you change the key of both dictionaries to "attack on titan", the program works as expected.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0