angr

Crates.ioangr
lib.rsangr
version0.1.0
sourcesrc
created_at2024-06-29 20:32:29.083789
updated_at2024-06-29 20:32:29.083789
descriptionA tool to analyse ngrams in text files.
homepagehttps://github.com/ash-entwisle/angr
repositoryhttps://github.com/ash-entwisle/angr
max_upload_size
id1287620
size10,461,694
Ash (ash-entwisle)

documentation

README

NGram Analysis

This is a tool to analyze the n-grams of a raw text corpus. It can be used to analyze the n-grams of a text file and generate a report of the n-grams found. I use this tool to get data on bigrams to optimise keyboard layouts, when doing it on raw text, I strip all punctuation and special characters from the text file with the following command:

sed 's/[^a-zA-Z ]//g' "text.txt" | tr 'A-Z' 'a-z' | sed -E 's/[[:space:]]+/ /g' >> text-clean.txt

Example data

There is some example data in the ./data directory. You can use this data to test the tool. This is a small excerpt from the Wikipedia Corpus off of corpusdata.org.

Commit count: 13

cargo fmt