How moth-logic/cherreader works
Cherreader is a C++17 console text indexer. The user selects a text file; the application retains original lines, tokenizes and indexes words, then offers prefix, exact-word, word-length, and frequency queries with optional line text and screen or file output. The README documents the workflow and capabilities; sampled source shows the Trie and its supporting structures, but some loading and menu code was omitted, so those links rely on README statements.
Main entry points: ConsoleApplication1.cpp Query handling · ArrayList.h Original lines · Trie.h Word index · BSTreeDictionary.h Child dictionary
Components 21
Application workflow
- Console workflow
ConsoleApplication1.cpp - Load and tokenize
ConsoleApplication1.cpp - Query handling
ConsoleApplication1.cpp - Ignore-word filter
ConsoleApplication1.cpp
Text index
- Original lines
ArrayList.h - Word index
Trie.h - Trie nodes
TrieNode.h - Frequency max-heap
MaxHeap.h
Data structures
- Child dictionary
BSTreeDictionary.h - Search tree
BSTree.h - Tree nodes
BSTNode.h - Key-value pairs
Pair.h - List interface
List.h - Doubly linked list
DoubleLinkedList.h - List nodes
DoubleNode.h - Dictionary interface
Dictionary.h
Results
- Formatted results
ConsoleApplication1.cpp
Other components
- Console user
- Text input
- Result text file
- Ignore words file
Connections 30
- Console user → Console workflow: chooses file and query
README.md - Text input → Load and tokenize: provides text
README.md - Console workflow → Load and tokenize: loads and tokenizes
README.md - Load and tokenize → Original lines: stores original lines
README.md - Load and tokenize → Word index: inserts words and lines
README.md - Console workflow → Query handling: dispatches queries
README.md - Query handling → Word index: searches index
README.md - Query handling → Original lines: retrieves line text
ConsoleApplication1.cpp - Query handling → Ignore-word filter: requests top words
README.md - Ignore words file → Ignore-word filter: supplies excluded words
README.md - Ignore-word filter → Word index: filters frequencies
README.md - Ignore-word filter → Frequency max-heap: loads filtered frequencies
README.md - Query handling → Formatted results: formats query results
ConsoleApplication1.cpp - Frequency max-heap → Formatted results: provides top words
README.md - Original lines → Formatted results: provides original text
ConsoleApplication1.cpp - Formatted results → Console user: prints results
README.md - Formatted results → Result text file: writes results
ConsoleApplication1.cpp - Word index → Trie nodes: traverses and updates
Trie.h - Trie nodes → Child dictionary: stores child nodes
TrieNode.h - Child dictionary → Search tree: stores key-value pairs
BSTreeDictionary.h - Search tree → Tree nodes: organizes tree nodes
BSTree.h - Search tree → Key-value pairs: orders elements
BSTreeDictionary.h - Child dictionary → Key-value pairs: creates pairs
BSTreeDictionary.h - Child dictionary → Dictionary interface: implements interface
BSTreeDictionary.h - Trie nodes → Doubly linked list: stores lines and children lists
TrieNode.h - Word index → Doubly linked list: builds result lists
Trie.h - Doubly linked list → List interface: implements interface
DoubleLinkedList.h - Doubly linked list → List nodes: links nodes
DoubleLinkedList.h - Original lines → List interface: implements interface
ArrayList.h - Frequency max-heap → Original lines: stores heap array
MaxHeap.h