# word-search

Parallel implementation of word-search algorithm in Haskell. 

Word search problem statement: https://leetcode.com/problems/word-search/


Project Proposal: https://docs.google.com/document/d/1GnlkhMjigE4JBTkc-_QdksV7Qv_zWgn2pvqUPopsYBE/edit?usp=sharing


## Build

```shell script
stack build
stack install
```

Note: `stack install` copies the executables to your local bin path. If that directory is not in your PATH, 
you should add it before proceeding to run

## Run Word Search

To run word-search,
```shell script
word-search-exe <input-grid.txt> <rows> <columns> <word> +RTS -N8 -s -ls
```

For e.g
```shell script
word-search-exe inputs/large_input_500.txt 500 500 "haskell" +RTS -N8 -s -ls
```

## Run Dictionary Search

To run dictionary-search,
```shell script
dict-search-exe <input-grid.txt> <dictionary.txt> <rows> <columns> <word> +RTS -N8 -s -ls
```

For e.g
```shell script
dict-search-exe inputs/large_input_500.txt inputs/1000-english.txt 500 500 +RTS -N8 -s -ls
```

References: 
1. https://leetcode.com/problems/word-search/
2. https://github.com/first20hours/google-10000-english
3. https://stackoverflow.com/questions/4978578/how-to-split-a-string-in-haskell
