Skip to content

Commit 670807c

Browse files
committed
Initial big commit
0 parents  commit 670807c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+254197
-0
lines changed

.formatter.exs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Used by "mix format"
2+
[
3+
line_length: 120,
4+
inputs: ["{mix,.formatter}.exs", "{config,lib,test}/**/*.{ex,exs}"]
5+
]

.gitignore

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# The directory Mix will write compiled artifacts to.
2+
/_build/
3+
4+
# If you run "mix test --cover", coverage assets end up here.
5+
/cover/
6+
7+
# The directory Mix downloads your dependencies sources to.
8+
/deps/
9+
10+
# Where third-party dependencies like ExDoc output generated docs.
11+
/doc/
12+
13+
# Ignore .fetch files in case you like to edit your project deps locally.
14+
/.fetch
15+
16+
# If the VM crashes, it generates a dump, let's ignore it too.
17+
erl_crash.dump
18+
19+
# Also ignore archive artifacts (built via "mix archive.build").
20+
*.ez
21+
22+
# Ignore package tarball (built via "mix hex.build").
23+
checkcheckcheck-*.tar
24+
25+
# Temporary files, for example, from tests.
26+
/tmp/
27+
28+
.elixir_ls

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# checkcheckcheck
2+
3+
A small Spelling Corrector written with Elixir to discover the language, and learn some new things!
4+
5+
## Usage
6+
7+
To get errors and suggestions from an input file or a string:
8+
`mix correct FILE_PATH | STRING`
9+
10+
## Examples
11+
12+
```
13+
$ mix correct "hello wrld waht is up?
14+
Errors in input:
15+
Word: wrld, Suggestions: [world, wild, weld]
16+
Word: waht, Suggestions: [what, wat, wah]
17+
```
18+
19+
```
20+
$ ex: `mix correct ./data/inputs/ashford-short.txt`
21+
Errors in input:
22+
Word: peaple, Suggestions: [people, peale, pepple]
23+
Word: salteena, Suggestions: []
24+
Word: wiskers, Suggestions: [whiskers, weskers, wishers]
25+
... lots more
26+
```
27+
28+
## Running tests
29+
30+
Simply run: `mix test`
31+
32+
## Performance tests
33+
34+
`./data/inputs/ashford-short.txt`
35+
Total time: 1.176746s
36+
Words: 490
37+
Words per second: 416.41 word/s
38+
39+
`./data/inputs/ashford.txt`
40+
Total time: 58.445784s
41+
Words: 12,484
42+
Words per second: 213.6 word/s
43+
44+
`"hello wrld waht is up?"`
45+
Total time: 0.104436s
46+
Words: 5
47+
Words per second: 47.88 word/s

TODO.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- [ ] Have a better dictionnary, with probability
2+
- [ ] Be faster?
3+
- [ ] Give up this project and start something new to also give up

0 commit comments

Comments
 (0)