Skip to main content
100%

Finding reduplicated words in a wordlist

✓ Published0🌍 Public
Aamundo
Last edited Nov 27, 2012
Created on Nov 27, 2012

This example scans a wordlist for reduplicated words—words whose letter pairs repeat—by analyzing bigram frequency. It computes the median frequency of all bigrams in each word and prints the word if that median equals 2, indicating a likely reduplication. The Python script uses `collections.Counter` to tally bigrams, a custom `median()` function, and `fileinput` to read lines from standard input. The output is a filtered list of words, showing a simple text-based visualization of the detected pattern.

AI-generated description

Similar vizzes