Module: Kotoshu::Core

Defined in:
lib/kotoshu/core.rb,
lib/kotoshu/core/trie/node.rb,
lib/kotoshu/core/trie/trie.rb,
lib/kotoshu/core/trie/builder.rb,
lib/kotoshu/core/indexed_dictionary.rb

Overview

Core domain models and infrastructure.

This module contains the fundamental domain models for the spell checker:

  • IndexedDictionary: Fast word lookup with multiple indexes

  • Trie: Prefix tree data structure for efficient string operations

  • Models: Value objects and result types

Examples:

Creating an indexed dictionary

dict = Kotoshu::Core::IndexedDictionary.new(%w[hello world test])
dict.include?("hello")  # => true

Creating a trie

trie = Kotoshu::Core::Trie::Trie.new
trie.insert("hello")
trie.lookup("hello")  # => true

Defined Under Namespace

Modules: Trie Classes: IndexedDictionary