Closed alemesa closed 3 years ago
The one for BJ doesn't provide a list of words that match the prefix, it only suggests the first match it finds in the array.
Are we leaning towards building one from scratch or using an existing npm module ? If we are building ourself, we should base it on ternary search tree. There are also some implementations with JS out there that we can use as reference.
I think it will be helpful to have a separate module for outputting the Ternary Search Tree data model. For example, the module will take an array of words or short sentences and then output the model that we could store somewhere. We could store it in RDBMS and call it with lambda function or a cache it in GraphQL Apollo server for offline access.
@jeff-ong created a component for BJ to do this.