MCPcopy Index your code
hub / github.com/daac-tools/crawdad

github.com/daac-tools/crawdad @v0.4.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.4.0 ↗ · + Follow
141 symbols 301 edges 9 files 23 documented · 16%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

🦞 Crawdad: ChaRActer-Wise Double-Array Dictionary

Crates.io Documentation Build Status

Overview

Crawdad is a library of natural language dictionaries using character-wise double-array tries. The implementation is optimized for strings of multibyte-characters, and you can enjoy fast text processing on strings such as Japanese or Chinese.

For example, on a large Japanese dictionary of IPADIC+Neologd, Crawdad has a better time-space tradeoff than other Rust libraries.

The detailed experimental settings and other results are available on Wiki.

What can do

  • Key-value mapping: Crawdad stores a set of string keys with mapping arbitrary integer values.
  • Exact match: Crawdad supports a fast lookup for an input key.
  • Common prefix search: Crawdad supports fast common prefix search that can be used to enumerate all keys appearing in a text.

Data structures

Crawdad contains the two trie implementations:

  • crawdad::Trie is a standard trie form that often provides the fastest queries.
  • crawdad::MpTrie is a minimal-prefix trie form that is memory-efficient for long strings.

License

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

For softwares under bench/data, follow the license terms of each software.

Acknowledgment

The initial version of this software was developed by LegalForce, Inc., but not an officially supported LegalForce product.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Core symbols most depended-on inside this repo

get
called by 20
src/mapper.rs
node_mut
called by 13
src/builder.rs
measure
called by 13
bench/src/measure.rs
value
called by 10
src/mptrie.rs
common_prefix_search
called by 8
src/trie.rs
node_ref
called by 7
src/builder.rs
set_next
called by 7
src/builder.rs
set_prev
called by 7
src/builder.rs

Shape

Method 85
Function 41
Class 14
Enum 1

Languages

Rust100%

Modules by API surface

src/mptrie.rs32 symbols
src/builder.rs32 symbols
src/trie.rs30 symbols
bench/src/measure.rs11 symbols
src/lib.rs9 symbols
src/mapper.rs8 symbols
src/errors.rs8 symbols
bench/benches/search.rs6 symbols
src/utils.rs5 symbols

For agents

$ claude mcp add crawdad \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact