Company
Date Published
Author
Nicole White
Word count
1664
Language
English
Hacker News points
None

Summary

The author has implemented a Markov chain-based autocompletion system for Cypher keywords in their CLI tool cycli. The system uses a dictionary of tuples, where each tuple contains a keyword and its probability of being used next given the current keyword. The probabilities are calculated based on the order of appearance of each keyword in a dataset of Cypher queries scraped from the GraphGist wiki. The author has demonstrated how to use this data structure to provide more intelligent autocompletion suggestions for Cypher keywords, such as suggesting `WHERE` and `WITH` after a `MATCH` keyword, rather than just listing all possible keywords alphabetically. This approach is expected to improve the user experience of the cycli tool by providing more relevant and context-dependent suggestions.