# ngrams

Published articles for ngrams.

This is one page of public article previews, not the complete archive. Follow Next page to continue. Summaries are not the original full articles.

## Cryptanalysis with N-Grams

DevFeed: [Cryptanalysis with N-Grams](<https://devfeed.tech/articles/cryptanalysis-with-n-grams-40260.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2012/02/03/cryptanalysis-with-n-grams/>)

Published: 2012-02-03T13:52:16Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Computing](<https://devfeed.tech/topics/computing.md>), [Cryptography](<https://devfeed.tech/topics/cryptography.md>), [Decoding](<https://devfeed.tech/topics/decoding.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Python](<https://devfeed.tech/topics/python.md>), [Encryption](<https://devfeed.tech/topics/encryption.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [code](<https://devfeed.tech/tags/code.md>), [computing](<https://devfeed.tech/tags/computing.md>), [cryptanalysis](<https://devfeed.tech/tags/cryptanalysis.md>), [decoding](<https://devfeed.tech/tags/decoding.md>), [linguistics](<https://devfeed.tech/tags/linguistics.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [natural-language-data](<https://devfeed.tech/tags/natural-language-data.md>), [ngrams](<https://devfeed.tech/tags/ngrams.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [substitution-cipher](<https://devfeed.tech/tags/substitution-cipher.md>), [techniques](<https://devfeed.tech/tags/techniques.md>)

### AI overview

This tutorial explains how to decode substitution ciphers using n-gram-based word segmentation and a local-search algorithm over possible decryptions. It introduces the relevant concepts, implements the approach in Python, and tests it on historical substitution ciphers.

### Source excerpt

This post is the third post in a series on computing with natural language data sets. For the first two posts, see the relevant section of our main content page. A Childish Bit of Fun In this post, we focus on the problem of decoding substitution ciphers. First, we'll describe a few techniques humans use to crack ciphers. We'll find these unsatisfactory, and move on to a simplistic algorithm which does a local search on the space of all possible decryptions, where we utilize our word segmentation algorithm from last time to determine the likelihood that a decryption is correct.

## Word Segmentation with Google's N-Gram Corpus

DevFeed: [Word Segmentation with Google's N-Gram Corpus](<https://devfeed.tech/articles/word-segmentation-or-makingsenseofthis-40255.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2012/01/15/word-segmentation/>)

Published: 2012-01-15T11:10:51Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Programming](<https://devfeed.tech/topics/programming.md>), [Algorithm](<https://devfeed.tech/topics/algorithm.md>), [Google](<https://devfeed.tech/topics/google.md>), [Code](<https://devfeed.tech/topics/code.md>), [Python](<https://devfeed.tech/topics/python.md>)

Tags: [algorithm](<https://devfeed.tech/tags/algorithm.md>), [article](<https://devfeed.tech/tags/article.md>), [code](<https://devfeed.tech/tags/code.md>), [dynamic-programming](<https://devfeed.tech/tags/dynamic-programming.md>), [google](<https://devfeed.tech/tags/google.md>), [linguistics](<https://devfeed.tech/tags/linguistics.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [naive-bayes](<https://devfeed.tech/tags/naive-bayes.md>), [ngrams](<https://devfeed.tech/tags/ngrams.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>)

### AI overview

This tutorial explains word segmentation, counts the exponentially many possible segmentations, and introduces a dynamic-programming approach using a simple model based on a subset of Google's n-gram corpus.

### Source excerpt

A First Look at Google's N-Gram Corpus In this post we will focus on the problem of finding the appropriate word boundaries in strings like "homebuiltairplanes", as is common in web URLs like www.homebuiltairplanes.com. This is an interesting problem because humans do it so easily, but there is no obvious programmatic solution. We will begin this article by addressing the complexity of this problem, continue by implementing a simple model using a subset of Google's n-gram corpus, and finish by describing our future plans to enhance the model.

## Metrics on Words

DevFeed: [Metrics on Words](<https://devfeed.tech/articles/metrics-on-words-40250.md>)

Original publisher: [Read original article](<https://www.jeremykun.com/2011/12/19/metrics-on-words/>)

Published: 2011-12-19T20:59:31Z

Content type: tutorial

Language: en

Sources: [Jeremy Kun](<https://devfeed.tech/sources/jeremy-kun.md>)

Topics: [Mathematics](<https://devfeed.tech/topics/mathematics.md>), [Programming](<https://devfeed.tech/topics/programming.md>), [Algorithms](<https://devfeed.tech/topics/algorithms.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [algorithms](<https://devfeed.tech/tags/algorithms.md>), [analysis](<https://devfeed.tech/tags/analysis.md>), [code](<https://devfeed.tech/tags/code.md>), [decoding](<https://devfeed.tech/tags/decoding.md>), [dynamic-programming](<https://devfeed.tech/tags/dynamic-programming.md>), [functional-programming](<https://devfeed.tech/tags/functional-programming.md>), [github](<https://devfeed.tech/tags/github.md>), [levenshtein-distance](<https://devfeed.tech/tags/levenshtein-distance.md>), [linguistics](<https://devfeed.tech/tags/linguistics.md>), [mathematics](<https://devfeed.tech/tags/mathematics.md>), [metric](<https://devfeed.tech/tags/metric.md>), [monoids](<https://devfeed.tech/tags/monoids.md>), [ngrams](<https://devfeed.tech/tags/ngrams.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [programming](<https://devfeed.tech/tags/programming.md>), [python](<https://devfeed.tech/tags/python.md>), [string](<https://devfeed.tech/tags/string.md>)

### AI overview

This introductory article defines finite strings over an alphabet and explains that they form a monoid under concatenation, with the empty string as the identity element. It introduces a series on probabilistic analysis of Google's ngrams for tasks including spelling correction, word segmentation, typing prediction, and cipher decoding.

### Source excerpt

We are about to begin a series where we analyze large corpora of English words. In particular, we will use a probabilistic analysis of Google's ngrams to solve various tasks such as spelling correction, word segmentation, on-line typing prediction, and decoding substitution ciphers. This will hopefully take us on a wonderful journey through elementary probability, dynamic programming algorithms, and optimization. As usual, the code implemented in this post is available from this blog's Github page, and we encourage the reader to use the code to implement our suggested exercises.