https://github.com/rf-/ingrid_core
Crossword-generating library and CLI tool
https://github.com/rf-/ingrid_core
constraint-satisfaction-problem crossword rust
Last synced: 3 months ago
JSON representation
Crossword-generating library and CLI tool
- Host: GitHub
- URL: https://github.com/rf-/ingrid_core
- Owner: rf-
- License: mit
- Created: 2022-10-16T22:13:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-11T02:58:47.000Z (7 months ago)
- Last Synced: 2025-03-31T13:19:28.197Z (3 months ago)
- Topics: constraint-satisfaction-problem, crossword, rust
- Language: Rust
- Homepage: https://ingrid.cx
- Size: 2.08 MB
- Stars: 41
- Watchers: 5
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ingrid Core
This crate contains the core crossword-solving code used in the Ingrid
construction app, as well as a standalone binary that can be used to solve
grids from the command line.### Usage
After [setting up Rust](https://rustup.rs), you can install the Ingrid Core CLI
tool with `cargo`:
```
$ cargo install ingrid_core
```Then you just need to provide a grid as an input file:
```
$ cat example_grid.txt
....#.....#....
....#.....#....
...............
......##.......
###.....#......
............###
.....#.....#...
....#.....#....
...#.....#.....
###cremebrulees
......#.....###
.......##......
...............
....#.....#....
....#.....#....
$ ingrid_core example_grid.txt
bile#seeit#slaw
room#lasso#pone
intimateapparel
garret##whirred
###amens#easels
wisterialane###
aloes#nuevo#tnt
ssns#betty#ciao
pas#wipes#pelts
###cremebrulees
dealin#deere###
imgonna##aesops
goingintodetail
utne#anise#atta
pegs#lemur#shay
```You can also use a custom word list (the default is [Spread the
Wordlist](https://www.spreadthewordlist.com)) or customize various other
options:
```
$ ingrid_core --help
ingrid_core: Command-line crossword generation toolUsage: ingrid_core [OPTIONS]
Arguments:
Path to the grid file, as ASCII with # representing blocks and . representing empty squaresOptions:
--wordlist
Path to a scored wordlist file [default: (embedded copy of Spread the Wordlist)]
--min-score
Minimum allowable word score [default: 50]
--max-shared-substring
Maximum shared substring length between entries [default: none]
-h, --help
Print help information
-V, --version
Print version information
```### Acknowledgments
* The backtracking search implementation in this library owes a lot to
"Adaptive Strategies for Solving Constraint Satisfaction Problems" by
Thanasis Balafoutis, which was helpful both as an overview of the CSP space
and a source of specific implementation ideas.* The CLI tool includes a copy of the free [Spread the
Wordlist](https://www.spreadthewordlist.com) dictionary published by Brooke
Husic and Enrique Henestroza Anguiano.