I'm using Bass Jobsen's Bootstrap 3 Typeahead, but for a non-standard use-case. I have a text input field where I expect full sentences and would like to help my users create them. I've used the matcher and updater functions suggested in this answer to append suggested words to the end of the sentence.
My problem is in defining context-specific autocomplete, so that if the general sentences I'd expect my users to type are something like, "I see the table in front of the chair." I could filter down the possible suggestions based on what types of words have already been used. For example, never suggest "see" after "table".
I plan on checking the input box on change, then reloading the source data for typeahead based on the current text in the input box. But, is there a more elegant solution than reloading the JSON source dynamically? Is there a way for me to load it all at once, then have the matcher apply only to a subset of the data?
json
. – Panoply